From 911fb688507b1984ccb2ecf47e36907916b51a25 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Wed, 8 Oct 2025 17:41:05 +0000 Subject: [PATCH 01/72] on #scripts_130_ian: first mods on setenv.bash made, and file scripts/stools/setenv_PBS_ian.bash added for ian machine. --- scripts/setenv.bash | 8 +++- scripts/stools/setenv_PBS_ian.bash | 69 ++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+), 2 deletions(-) mode change 100755 => 100644 scripts/setenv.bash create mode 100755 scripts/stools/setenv_PBS_ian.bash diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100755 new mode 100644 index 6145517..ab40c5f --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash @@ -24,6 +24,10 @@ if [ ${THOSTNAME} = "egeon-login" -o ${THOSTNAME} = "headnode" ] then export HOSTNAME="egeon" fi +if [ ${THOSTNAME} = "ian01" -o ${THOSTNAME} = "ian02" ] +then + export HOSTNAME="ian" +fi # Make the same for other machines/systems... echo "Host detected: $HOSTNAME" @@ -42,7 +46,7 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/mnt/beegfs/carlos.souza/issues/801-scripts_CDCT_multi-env/scripts_CD-CT/sources/MONAN-Model_1.4.2-rc +export MONANDIR=/p/home/carlos.souza/monan/scripts_CD-CT/sources/MONAN-Model_1.4.2-rc # Load your systm setenv: diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash new file mode 100755 index 0000000..6821096 --- /dev/null +++ b/scripts/stools/setenv_PBS_ian.bash @@ -0,0 +1,69 @@ +#!/bin/bash + +# Load modules: + +module purge +module load PrgEnv-gnu +module load cray-netcdf +module load cray-parallel-netcdf +module load grads/2.2.1 +#module load metis ??? + +module list + + +# Submiting variables: + +# PRE-Static phase: +export STATIC_QUEUE="batch" +export STATIC_ncores=32 +export STATIC_nnodes=1 +export STATIC_ncpn=32 +export STATIC_jobname="Pre.static" +export STATIC_walltime="02:00:00" + + +# PRE-Degrib phase: +export DEGRIB_QUEUE="batch" +export DEGRIB_ncores=1 +export DEGRIB_nnodes=1 +export DEGRIB_ncpn=1 +export DEGRIB_jobname="Pre.degrib" +export DEGRIB_walltime="02:00:00" + + +# PRE-Init Atmosphere phase: +export INITATMOS_QUEUE="batch" +export INITATMOS_ncores=64 +export INITATMOS_nnodes=1 +export INITATMOS_ncpn=64 +export INITATMOS_jobname="Pre.InitAtmos" +export INITATMOS_walltime="02:00:00" + + +# Model phase: +export MODEL_QUEUE="batch" +export MODEL_ncores=512 +export MODEL_nnodes=8 +export MODEL_ncpn=64 +export MODEL_jobname="Model.MONAN" +export MODEL_walltime="8:00:00" + + +# Post phase: +export POST_QUEUE="batch" +### export POST_ncores=1 not used yet +export POST_nnodes=1 +export POST_ncpn=32 +export POST_jobname="Post.MONAN" +export POST_walltime="8:00:00" + + +# Libraries paths: +export NETCDF=${NETCDF_DIR} +export PNETCDF=${PNETCDF_DIR} +export NETCDFDIR=${NETCDF} +export PNETCDFDIR=${PNETCDF} +export DIRDADOS=/p/home/monan/dados/MONAN_v1.4.x ###??? +### ??? export OPERDIR=/oper/dados/ioper/tempo + From 64baa5644e8b2ec2c74c062dd0fe788198b8230a Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Wed, 8 Oct 2025 18:19:03 +0000 Subject: [PATCH 02/72] #833: new branch created manually, new host ian detec implemented in setenv.bash, now it identifies whatever ian## the user are: ian[0-9]*) HOSTNAME=ian it identify ian01... until ian99. --- scripts/setenv.bash | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) mode change 100644 => 100755 scripts/setenv.bash diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100644 new mode 100755 index ab40c5f..f8afde6 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -20,14 +20,17 @@ fi THOSTNAME=$(hostname -s) # Identifying several names of the egeon: -if [ ${THOSTNAME} = "egeon-login" -o ${THOSTNAME} = "headnode" ] -then - export HOSTNAME="egeon" -fi -if [ ${THOSTNAME} = "ian01" -o ${THOSTNAME} = "ian02" ] -then - export HOSTNAME="ian" -fi +case ${THOSTNAME} in + egeon-login|headnode) + HOSTNAME="egeon" + ;; + ian[0-9]*) + HOSTNAME="ian" + ;; +esac +export HOSTNAME + + # Make the same for other machines/systems... echo "Host detected: $HOSTNAME" From 3aee442c9a39df14a9b2b392b7e0f00a71863c88 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Mon, 13 Oct 2025 18:08:55 +0000 Subject: [PATCH 03/72] on833: minha primeira versao rodando 24km OK --- scripts/1.install_monan.bash | 37 ++- scripts/2.pre_processing.bash | 13 +- scripts/3.run_model.bash | 28 +- scripts/3.run_model.bash_sylvio | 278 ++++++++++++++++++ scripts/4.run_post.bash | 77 ++++- scripts/make_degrib.bash | 152 ++++++++-- scripts/make_initatmos.bash | 38 ++- scripts/make_static.bash | 37 ++- scripts/make_template.bash | 24 ++ scripts/namelists/include_fields.diag | 0 scripts/namelists/include_fields.diag.CD-CT | 0 scripts/namelists/include_fields.diag.GCC | 0 scripts/namelists/include_fields.diag.OPER | 0 .../stream_list.atmosphere.diagnostics | 0 .../stream_list.atmosphere.diagnostics.CD-CT | 0 .../stream_list.atmosphere.diagnostics.GCC | 0 .../stream_list.atmosphere.diagnostics.OPER | 0 .../namelists/stream_list.atmosphere.output | 0 .../namelists/stream_list.atmosphere.surface | 0 scripts/setenv.bash | 23 +- scripts/stools/setenv_PBS_ian.bash | 52 +++- scripts/stools/submit_PBS_ian.bash_TEMPLATE | 12 + .../stools/submit_SLURM_egeon.bash_TEMPLATE | 4 +- 23 files changed, 674 insertions(+), 101 deletions(-) create mode 100755 scripts/3.run_model.bash_sylvio mode change 100644 => 100755 scripts/namelists/include_fields.diag mode change 100644 => 100755 scripts/namelists/include_fields.diag.CD-CT mode change 100644 => 100755 scripts/namelists/include_fields.diag.GCC mode change 100644 => 100755 scripts/namelists/include_fields.diag.OPER mode change 100644 => 100755 scripts/namelists/stream_list.atmosphere.diagnostics mode change 100644 => 100755 scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT mode change 100644 => 100755 scripts/namelists/stream_list.atmosphere.diagnostics.GCC mode change 100644 => 100755 scripts/namelists/stream_list.atmosphere.diagnostics.OPER mode change 100644 => 100755 scripts/namelists/stream_list.atmosphere.output mode change 100644 => 100755 scripts/namelists/stream_list.atmosphere.surface create mode 100755 scripts/stools/submit_PBS_ian.bash_TEMPLATE diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index b96d65b..9fe065e 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -160,7 +160,7 @@ echo "" echo -e "${GREEN}==>${NC} Making compile script...\n" cd $MONANDIR - +read -p "escrevendo o make-all" cat << EOF > make-all.sh #!/bin/bash #Usage: make target CORE=[core] [options] @@ -195,6 +195,8 @@ cat << EOF > make-all.sh . ${SCRIPTS}/setenv.bash + + rm -rf $MONANDIR/default_inputs/ $MONANDIR/src/core_atmosphere/physics/physics_wrf/files rm -f $MONANDIR/stream_list.* $MONANDIR/streams.* $MONANDIR/namelist.* rm -f $MONANDIR/make*.output.atmosphere $MONANDIR/make*.output.init_atmosphere @@ -207,8 +209,17 @@ export PNETCDF=${PNETCDFDIR} export PIO= MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" + +echo "fazendo o make atmosphere" +read -p "fazendo make atmosphere" make clean CORE=atmosphere -make -j 8 gfortran CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +#make -j 8 gfortran CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} + +echo "compilando o atomosphere" +read -p "compilando o atmosphere" + +make -j 8 intel CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} + #CR: TODO: put verify here if executable was created ok mv ${MONANDIR}/atmosphere_model ${EXECS} @@ -219,7 +230,10 @@ make clean CORE=atmosphere MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" make clean CORE=init_atmosphere -make -j 8 gfortran CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +#make -j 8 gfortran CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +make -j 8 intel CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} + + mv ${MONANDIR}/init_atmosphere_model ${EXECS} make clean CORE=init_atmosphere @@ -240,24 +254,27 @@ chmod a+x make-all.sh echo "" echo -e "${GREEN}==>${NC} Installing init_atmosphere_model and atmosphere_model...\n" echo "" - +read -p "rodando make-all..." . ${MONANDIR}/make-all.sh + +read -p "instalando convert mpas" # install convert_mpas echo "" echo -e "${GREEN}==>${NC} Moduling environment for convert_mpas...\n" -module purge -module load gnu9/9.4.0 -module load ohpc -module load phdf5 -module load netcdf -module load netcdf-fortran +#module purge +#module load gnu9/9.4.0 +#module load ohpc +#module load phdf5 +#module load netcdf +#module load netcdf-fortran module list cd ${CONVERT_MPAS_DIR} echo "" echo -e "${GREEN}==>${NC} Installing convert_mpas...\n" +read -p "aperte enter para instalar convert mpas" make clean make 2>&1 | tee make.convert.output diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index e0a37a2..e10cc48 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -45,6 +45,10 @@ echo "" echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash + +read -p "carregando variaveis de ambiente" + + echo "" echo "---- Pre Processing ----" echo "" @@ -95,7 +99,7 @@ case "${SYSTEM_KEY}" in ;; esac - +read -p "fazendo o make static" # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- if [ ! -s ${DATAIN}/fixed/x1.${RES}.static.nc ] @@ -107,13 +111,18 @@ else fi #---------------------------------------------------------------------------------- +read -p "fazendo degrib do gfs" + # Degrib phase:--------------------------------------------------------------------- echo -e "${GREEN}==>${NC} Running Degrib:\n" -time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #---------------------------------------------------------------------------------- + +read -p "fazendo o init atmosphere" + # Init Atmosphere phase:------------------------------------------------------------ echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 7e9ddde..c1aebe3 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -162,10 +162,13 @@ fi cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} ${DIRRUN}/stream_list.atmosphere.diagnostics cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} +cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} -cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +chmod 755 ${DIRRUN} + rm -f ${DIRRUN}/model.bash if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] @@ -176,23 +179,26 @@ then s,#NTASKSPNODE#,${MODEL_ncpn},g; s,#PARTITION#,${MODEL_QUEUE},g; s,#WALLTIME#,${MODEL_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o%j,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e%j,g" \ + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/model.bash else echo "#!/bin/bash " > ${DIRRUN}/model.bash fi cat << EOF0 >> ${DIRRUN}/model.bash + + export executable=atmosphere_model ulimit -c unlimited ulimit -v unlimited ulimit -s unlimited -. $(pwd)/setenv.bash - cd ${DIRRUN} +. setenv.bash +. setenv_PBS_ian.bash + date time mpirun -np ${MODEL_ncores} ./\${executable} @@ -223,11 +229,13 @@ case "${SCHEDULER_SYSTEM}" in cd ${DIRRUN} sbatch --wait ${DIRRUN}/model.bash ;; -# PBS) -# echo "Rodando em PBS" -# cd ${DIRRUN} -# # comandos qsub, qstat, etc. -# ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" + cd ${DIRRUN} + exit + qsub -W block=true ${DIRRUN}/model.bash + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # cd ${DIRRUN} diff --git a/scripts/3.run_model.bash_sylvio b/scripts/3.run_model.bash_sylvio new file mode 100755 index 0000000..ce11a01 --- /dev/null +++ b/scripts/3.run_model.bash_sylvio @@ -0,0 +1,278 @@ +#!/bin/bash +#-----------------------------------------------------------------------------# +# !SCRIPT: run_model +# +# !DESCRIPTION: +# Script to run the MONAN model over the forecast horizon. +# +# Performs the following tasks: +# +# o VCheck all input files before +# o Creates the submition script +# o Submit the model +# o Veriffy all files generated +# +# +#-----------------------------------------------------------------------------# + +if [ $# -ne 4 -a $# -ne 1 ] +then + echo "" + echo "Instructions: execute the command below" + echo "" + echo "${0} [EXP_NAME/OP] RESOLUTION LABELI FCST" + echo "" + echo "EXP_NAME :: Forcing: GFS" + echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" + echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" + echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." + echo "" + echo "24 hour forecast example for 24km:" + echo "${0} GFS 1024002 2024010100 24" + echo "48 hour forecast example for 120km:" + echo "${0} GFS 40962 2024010100 48" + echo "" + + exit +fi + +# Set environment variables exports: +echo "" +echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" +. setenv.bash + +echo "" +echo "---- Run Model ----" +echo "" + + +# Standart directories variables:--------------------------------------- +DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} +SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} +DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} +DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} +SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} +EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} +#---------------------------------------------------------------------- + + +# Input variables:-------------------------------------- +EXP=${1}; #EXP=GFS +RES=${2}; #RES=1024002 +YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 +FCST=${4}; #FCST=6 +#------------------------------------------------------- +mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Model/logs + + +# Local variables-------------------------------------- +start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 +cores=${MODEL_ncores} +hhi=${YYYYMMDDHHi:8:2} +NLEV=55 +CONFIG_CONV_INTERVAL="00:30:00" +VARTABLE=".OPER" +export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} +#------------------------------------------------------------------------------------ + +# Variables for flex outpout interval from streams.atmosphere------------------------ +t_strout=$(cat ${SCRIPTS}/namelists/streams.atmosphere.TEMPLATE | sed -n '//s/.*output_interval="\([^"]*\)".*/\1/p') +t_stroutsec=$(echo ${t_strout} | awk -F: '{print ($1 * 3600) + ($2 * 60) + $3}') +t_strouthor=$(echo "scale=4; (${t_stroutsec}/60)/60" | bc) +#------------------------------------------------------------------------------------ + +# Format to HH:MM:SS t_strout (output_interval) +IFS=":" read -r h m s <<< "${t_strout}" +printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" +# From now on, CONFI_LEN_DISP becames cte = 0.0, pickin up this value from static file. + +# Calculating default parameters for different resolutions +if [ $RES -eq 1024002 ]; then #24Km + CONFIG_DT=150.0 + CONFIG_CONV_INTERVAL="00:15:00" +elif [ $RES -eq 2621442 ]; then #15Km + CONFIG_DT=90.0 + CONFIG_CONV_INTERVAL="00:15:00" +elif [ $RES -eq 40962 ]; then #120Km + CONFIG_DT=600.0 +elif [ $RES -eq 5898242 ]; then #10Km + CONFIG_DT=60.0 + CONFIG_LEN_DISP=10000.0 + CONFIG_CONV_INTERVAL="00:15:00" +fi +#------------------------------------------------------- + + +# Calculating final forecast dates in model namelist format: DD_HH:MM:SS +# using: start_date(yyyymmdd) + FCST(hh) : +ind=$(printf "%02d\n" $(echo "${FCST}/24" | bc)) +inh=$(printf "%02.0f\n" $(echo "((${FCST}/24)-${ind})*24" | bc -l)) +DD_HHMMSS_forecast=$(echo "${ind}_${inh}:00:00") + + +if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] +then + if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] + then + cd ${DATAIN}/fixed + echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" + wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz + wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz + tar -xzvf x1.${RES}.tar.gz + tar -xzvf x1.${RES}_static.tar.gz + fi + echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" + cd ${DATAIN}/fixed + gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} + rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz +fi + + +files_needed=("${SCRIPTS}/namelists/stream_list.atmosphere.output" ""${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} "${SCRIPTS}/namelists/stream_list.atmosphere.surface" "${EXECS}/atmosphere_model" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${DATAIN}/fixed/Vtable.GFS") +for file in "${files_needed[@]}" +do + if [ ! -s "${file}" ] + then + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" + exit -1 + fi +done + +cp -f ${EXECS}/atmosphere_model ${DIRRUN} +cp -f ${DATAIN}/fixed/*TBL ${DIRRUN} +cp -f ${DATAIN}/fixed/*DBL ${DIRRUN} +cp -f ${DATAIN}/fixed/*DATA ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} +cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${DIRRUN} +cp -f ${DATAIN}/fixed/Vtable.GFS ${DIRRUN} + + +if [ ${EXP} = "GFS" ] +then + sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; +s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g" \ + ${SCRIPTS}/namelists/namelist.atmosphere.TEMPLATE > ${DIRRUN}/namelist.atmosphere + + sed -e "s,#RES#,${RES},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ + ${SCRIPTS}/namelists/streams.atmosphere.TEMPLATE > ${DIRRUN}/streams.atmosphere +fi +cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} +cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} ${DIRRUN}/stream_list.atmosphere.diagnostics +cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} +cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} + + + +chmod 755 ${DIRRUN} + +rm -f ${DIRRUN}/model.bash + +if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] +then + sed -e "s,#JOBNAME#,${MODEL_jobname},g; + s,#NNODES#,${MODEL_nnodes},g; + s,#NTASKS#,${MODEL_ncores},g; + s,#NTASKSPNODE#,${MODEL_ncpn},g; + s,#PARTITION#,${MODEL_QUEUE},g; + s,#WALLTIME#,${MODEL_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o%j,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e%j,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/model.bash +else + echo "#!/bin/bash " > ${DIRRUN}/model.bash +fi + +cat << EOF0 >> ${DIRRUN}/model.bash +#!/bin/bash -x +#PBS -N ${MODEL_jobname} +#PBS -q ${MODEL_QUEUE} +#PBS -l select=${MODEL_nnodes}:ncpus=${MODEL_ncpn}:mpiprocs=${MODEL_ncpn} +#PBS -l walltime=${MODEL_walltime} +#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o${PBS_JOBID} +#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e${PBS_JOBID} +#PBS -l place=excl +#PBS -V +##PBS -l mem=500000 + + + + +export executable=atmosphere_model + +ulimit -c unlimited +ulimit -v unlimited +ulimit -s unlimited + +cd ${DIRRUN} +. setenv.bash +. setenv_PBS_ian.bash + + +date +time mpirun -np ${MODEL_ncores} ./\${executable} +date + +# +# move dataout, clean up and remove files/links +# +mv MONAN_DIAG_* ${DATAOUT}/${YYYYMMDDHHi}/Model +mv MONAN_HIST_* ${DATAOUT}/${YYYYMMDDHHi}/Model +cp -f ${EXECS}/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model +cp -f ${EXECS}/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/ +cp -f ${DIRHOMES}/VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/SCRIPTSCDCT-VERSION.txt +cp -f ${MONANDIR}/README.md ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/ +mv log.atmosphere.*.out ${DATAOUT}/${YYYYMMDDHHi}/Model/logs +mv log.atmosphere.*.err ${DATAOUT}/${YYYYMMDDHHi}/Model/logs +mv namelist.atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Model/logs +mv stream* ${DATAOUT}/${YYYYMMDDHHi}/Model/logs +EOF0 +chmod a+x ${DIRRUN}/model.bash + + +case "${SCHEDULER_SYSTEM}" in + SLURM) + echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" + echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/logs... \n" + echo -e "sbatch ${SCRIPTS}/model.bash" + cd ${DIRRUN} + sbatch --wait ${DIRRUN}/model.bash + ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" + cd ${DIRRUN} + qsub -W block=true ${DIRRUN}/model.bash + ;; +# GENERIC) +# echo "Nenhum gerenciador detectado" +# cd ${DIRRUN} +# ${DIRRUN}/model.bash +# ;; +esac +mv ${DIRRUN}/model.bash ${DATAOUT}/${YYYYMMDDHHi}/Model/logs + + +#-----Loop que verifica se os arquivos foram gerados corretamente (>0)----- +output_interval=${t_strouthor} +nfiles=$(echo "$FCST/$output_interval + 1" | bc) +for ii in $(seq 1 ${nfiles}) +do + i=$(printf "%04d" ${ii}) + hh=${YYYYMMDDHHi:8:2} + currentdate=$(date -d "${YYYYMMDDHHi:0:8} ${hh}:00:00 $(echo "(${i}-1)*${t_strout:0:2}" | bc) hours $(echo "(${i}-1)*${t_strout:3:2}" | bc) minutes $(echo "(${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") + file=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_${currentdate}.x${RES}L${NLEV}.nc + + if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} ] + then + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} [${0}] At least the file ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} was not generated. \n" + exit -1 + fi + +done + +rm -fr ${DIRRUN} diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 94961b6..26ecb80 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -130,6 +130,8 @@ do fi done +read -p "arquivos ok" + # Captura quantos arquivos do modelo tiverem para serem pos-processados e # quando nos serao necessarios para executar ${maxpostpernode} convert_mpas por no: #nfiles=$(ls -l ${DATAOUT}/${YYYYMMDDHHi}/Model/MONAN*nc | wc -l) @@ -143,12 +145,16 @@ how_many_nodes ${nfiles} ${maxpostpernode} # Cria os diretorios e arquivos/links para cada saida do convert_mpas: cd ${DIRRUN} + cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} + for ii in $(seq 1 ${nfiles}) do i=$(printf "%04d" ${ii}) mkdir -p ${DIRRUN}/dir.${i} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN}/dir.${i} + cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN}/dir.${i} cp -f ${SCRIPTS}/namelists/include_fields.diag${VARTABLE} ${DIRRUN}/dir.${i}/include_fields.diag${VARTABLE} cp -f ${DIRRUN}/dir.${i}/include_fields.diag${VARTABLE} ${DIRRUN}/dir.${i}/include_fields sed -e "s,#NISOLEV#,${NLEV},g;s,#NMODELLEV#,${N_MODEL_LEV},g" \ @@ -159,6 +165,7 @@ do done cd ${DIRRUN} +chmod 777 * # Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: node=1 @@ -185,8 +192,21 @@ do fi cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh +#!/bin/bash -x +#PBS -N MO.Pos${node} +#PBS -q ${POST_QUEUE} +#PBS -l select=1:ncpus=1:mpiprocs=1 +#PBS -l walltime=${POST_walltime} +#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} +#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} +#PBS -l place=excl +#PBS -V + -. ${DIRRUN}/setenv.bash +cd ${DIRRUN} +. ${SCRIPTS}/setenv.bash +. ${SCRIPTS}/stools/setenv_PBS_ian.bash +chmod 777 * echo "Executing posts ${inicio} to ${fim} in node Node ${node}." @@ -205,11 +225,13 @@ do i=\$(printf "%04d" \${ii}) echo "Executing post \${i}" cd ${DIRRUN}/dir.\${i} - + chmod 777 * hh=${YYYYMMDDHHi:8:2} currentdate=\$(date -d "${YYYYMMDDHHi:0:8} \${hh}:00:00 \$(echo "(\${i}-1)*${t_strout:0:2}" | bc) hours \$(echo "(\${i}-1)*${t_strout:3:2}" | bc) minutes \$(echo "(\${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") diag_name=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc - + echo "" + echo "executando convert mpas" + chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Model/* time ./convert_mpas x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Model/\${diag_name} > convert_mpas.output & echo "./convert_mpas x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Model/\${diag_name} > convert_mpas.output" done @@ -225,6 +247,7 @@ do diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.00.00.x${RES}L${N_MODEL_LEV}.nc cd ${DIRRUN}/dir.\${i} + chmod 777 * cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post} >> convert_mpas.output & echo "cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post}" >> convert_mpas.output @@ -235,8 +258,9 @@ wait EOSH chmod a+x ${DIRRUN}/PostAtmos_node.${node}.sh + chmod 755 ${DIRRUN}/* cp -f ${DIRRUN}/PostAtmos_node.${node}.sh ${DATAOUT}/${YYYYMMDDHHi}/Post/logs - + chmod 777 ${DATAOUT}/${YYYYMMDDHHi}/Post/* case "${SCHEDULER_SYSTEM}" in SLURM) echo "Sbatch PostAtmos_node.${node}.sh" @@ -244,10 +268,14 @@ EOSH echo "JobId node ${node} = ${jobid[${node}]} , convert_mpas ${inicio} to ${fim}" echo "" ;; -# PBS) -# echo "Rodando em PBS" -# # comandos qsub, qstat, etc. -# ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" + cd ${DIRRUN} + echo "executando qsub pegando jobid" + read -p "tecle enter" + jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # ${DIRRUN}/PostAtmos_node.${node}.sh @@ -255,8 +283,6 @@ EOSH esac - - inicio=$((fim + 1)) temp=$((fim + maxpostpernode)) fim=$(( temp < nfiles ? temp : nfiles )) @@ -299,7 +325,19 @@ fi cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh -. ${DIRRUN}/setenv.bash +#!/bin/bash +#PBS -N MO.Pos${node} +#PBS -q ${POST_QUEUE} +#PBS -l select=1:ncpus=1:mpiprocs=1 +#PBS -l walltime=${POST_walltime} +#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} +#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} +#PBS -V + + +cd ${DIRRUN} +. ${SCRIPTS}/setenv.bash +. ${SCRIPTS}/stools/setenv_PBS_ian.bash # Saving important files to the logs directory: cp -f ${EXECS}/CONVMPAS-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Post @@ -325,10 +363,15 @@ case "${SCHEDULER_SYSTEM}" in echo "Sbatch PostAtmos_node.${node}.sh" sbatch --wait --dependency=${dependency} ${DIRRUN}/PostAtmos_node.${node}.sh ;; -# PBS) -# echo "Rodando em PBS" -# # comandos qsub, qstat, etc. -# ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" + cd ${DIRRUN} + echo "submetendo de novo" + read -p "verificar" + jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) + + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # ${DIRRUN}/PostAtmos_node.${node}.sh @@ -337,4 +380,8 @@ esac #CR: passar este scriptpara dentro do script PostAtmos_node.0.sh, submetido. cd ${SCRIPTS} +echo "" +read -p "tudo certo - chamando make template" +echo "" +chmod 777 ${DATAOUT}/${YYYYMMDDHHi}/Post/* time ${SCRIPTS}/make_template.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index d77ccb0..843e8df 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -64,18 +64,56 @@ cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 +read -p "fazendo download do grib" +#Fazendo download da condicao de contorno +if [ "$SERVER" = "egeon" ]; then + if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then + echo "rsync OK!" + else + echo "rsync error!" + echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" + exit 1 + fi +else + if [ ! -e "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then + + if wget "http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" \ + -O "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2"; then + echo "wget OK!" + else + echo "wget error!" + echo "Link: http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" + exit 1 + fi + fi +fi +if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then + echo -e "${RED}==>${NC}Condicao de contorno inexistente !" + echo -e "${RED}==>${NC}Check ${BNDDIR} or." + echo -e "${RED}==>${NC}Check ${GCCCIS}" + exit 1 +fi + + + +read -p " Condicao de contorno ok em datain (GFS)" + + + + + # Se nao existir CI no diretorio do IO, # busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! #CR: BNDDIR should be setted just for EGEON machine #CR: some local variables were mobed into the SLURM section, particularly for egeon -case "${SYSTEM_KEY}" in - SLURM_egeon) +#case "${SYSTEM_KEY}" in +# SLURM_egeon) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, # to find the gfs file: - OPERDIREXP=${OPERDIR}/${EXP} - BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - GCCCIS=/mnt/beegfs/monan/CIs/${EXP} - ;; +# OPERDIREXP=${OPERDIR}/${EXP} +# BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} +# GCCCIS=/mnt/beegfs/monan/CIs/${EXP} +# ;; # PBS) # #CR: Here is the place to setup the CI directory into ${BNDDIR} var, # # to find the gfs file: @@ -88,23 +126,32 @@ case "${SYSTEM_KEY}" in # echo "Nenhum gerenciador detectado" # # BNDDIR= # ;; -esac +#esac #CR: maybe this if should belong to the SLURM kind of running... -if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -then - if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] - then - echo -e "${RED}==>${NC}Condicao de contorno inexistente !" - echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}" - exit 1 - else - BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} - fi -fi +#if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +#then +# if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +# then +# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" +# echo -e "${RED}==>${NC}Check ${BNDDIR} or." +# echo -e "${RED}==>${NC}Check ${GCCCIS}" +# exit 1 +# else +# BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} +# fi +#fi + + + +files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") + + + +#files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") + + -files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") for file in "${files_needed[@]}" do if [ ! -s "${file}" ] @@ -115,16 +162,28 @@ do fi done +echo "" +read -p "arquivos STATIC, Vtable, ungrib, e GFS ok" +echo "" + cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} -cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +#cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE - cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash + +read -p "arquivos copiados para dirrun)" +ls -ltr ${DIRRUN} +echo "" + +read -p "verificar arquivos em dirun, tem que quer , STATIC // Vtable // ungrib // gfs // namelist.wps // setenv.bash // link_grib //" + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; @@ -141,7 +200,28 @@ else fi +echo "" +read -p "verificar dirrun" +echo "" + cat << EOF0 >> ${DIRRUN}/degrib.bash +#!/bin/bash -x +#PBS -N ${DEGRIB_jobname} +#PBS -l select=${DEGRIB_nnodes}:ncpus=${DEGRIB_ncpn} +#PBS -l walltime=${STATIC_walltime} +#PBS -q ${DEGRIB_QUEUE} +#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o${PBS_JOBID} +#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e${PBS_JOBID} + + +# ----------------------------- +# Inicialização do ambiente PBS +# ----------------------------- +#cd $PBS_O_WORKDIR +echo "Rodando no host: $(hostname)" +echo "Diretório de submissão: $PBS_O_WORKDIR" +echo "Nós alocados:" +cat $PBS_NODEFILE ulimit -s unlimited ulimit -c unlimited @@ -149,11 +229,16 @@ ulimit -v unlimited export PMIX_MCA_gds=hash - export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 cd ${DIRRUN} . setenv.bash +. setenv_PBS_ian.bash + +echo"" +echo "listando os modulos" +echo "" +module list ldd ungrib.exe @@ -162,11 +247,20 @@ rm -f GRIBFILE.* namelist.wps sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps - +#read -p "executando o link_grib" +echo "" ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 +chmod 755 * +echo "" date +echo "submetendo jobs ungrib" + time mpirun -np 1 ./ungrib.exe + + +#time mpiexec -np 1 ./ungrib.exe +#time /opt/pbs/bin/mpiexec -np 1 ./ungrib.exe date @@ -202,10 +296,12 @@ case "${SCHEDULER_SYSTEM}" in cd ${DIRRUN} sbatch --wait ${DIRRUN}/degrib.bash ;; -# PBS) -# echo "Rodando em PBS" -# # comandos qsub, qstat, etc. -# ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch degrib.bash...\n" + cd ${DIRRUN} + qsub -W block=true ${DIRRUN}/degrib.bash + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # ${DIRRUN}/degrib.bash diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 203041f..c3199ef 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -102,9 +102,12 @@ cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}\:${start_date:0:13} ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} +cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} +chmod 755 ${DIRRUN}/* +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* -cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} rm -f ${DIRRUN}/initatmos.bash @@ -126,6 +129,18 @@ fi cat << EOF0 >> ${DIRRUN}/initatmos.bash +#!/bin/bash -x +#PBS -N ${INITATMOS_jobname} +#PBS -l select=${INITATMOS_nnodes}:ncpus=${INITATMOS_ncores} +#PBS -q ${INITATMOS_QUEUE} +#PBS -l walltime=${STATIC_walltime} +#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o${PBS_JOBID} +#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e${PBS_JOBID} +#PBS -l place=excl +##PBS -l mem=500000 + + + export executable=init_atmosphere_model ulimit -c unlimited @@ -133,14 +148,14 @@ ulimit -v unlimited ulimit -s unlimited -. $(pwd)/setenv.bash - cd ${DIRRUN} +. setenv.bash +. setenv_PBS_ian.bash - - +echo "" date -time mpirun -np ${INITATMOS_ncores} ./\${executable} +#time mpiexec -np ${INITATMOS_ncores} ./\${executable} +time mpirun -np ${INITATMOS_ncores} ./\${executable} date @@ -158,11 +173,12 @@ case "${SCHEDULER_SYSTEM}" in cd ${DIRRUN} sbatch --wait ${DIRRUN}/initatmos.bash ;; -# PBS) -# echo "Rodando em PBS" -# cd ${DIRRUN} -# # comandos qsub, qstat, etc. -# ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" + cd ${DIRRUN} + qsub -W block=true ${DIRRUN}/initatmos.bash + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # cd ${DIRRUN} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 52beb7b..27f698c 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -61,17 +61,20 @@ if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] then if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] then + mkdir -p ${DATAIN}/fixed cd ${DATAIN}/fixed echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz tar -xzvf x1.${RES}_static.tar.gz + chmod 777 * fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz + chmod 777 * fi @@ -92,6 +95,7 @@ cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ @@ -120,20 +124,36 @@ then else echo "#!/bin/bash " > ${DIRRUN}/static.bash fi - +chmod 755 ${DIRRUN}/* cat << EOF0 >> ${DIRRUN}/static.bash +#!/bin/bash -x +#PBS -N ${STATIC_jobname} +#PBS -l select=${STATIC_nnodes}:ncpus=${STATIC_ncores} +#PBS -q ${STATIC_QUEUE} +#PBS -l walltime=${STATIC_walltime} +#PBS -o ${DATAOUT}/logs/static.bash.o${PBS_JOBID} +#PBS -e ${DATAOUT}/logs/static.bash.e${PBS_JOBID} +#PBS -l place=excl +##PBS -l mem=500000 + + export executable=init_atmosphere_model ulimit -s unlimited ulimit -c unlimited ulimit -v unlimited -. $(pwd)/setenv.bash + +. ${SCRIPTS}/setenv.bash +. ${SCRIPTS}/stools/setenv_PBS_ian.bash cd ${DIRRUN} + +chmod 777 * date -time mpirun -np ${STATIC_ncores} ./\${executable} +time mpiexec -np ${STATIC_ncores} ./\${executable} +#time mpirun -np ${STATIC_ncores} ./\${executable} date grep "Finished running" log.init_atmosphere.0000.out >& /dev/null @@ -164,11 +184,12 @@ case "${SCHEDULER_SYSTEM}" in cd ${DIRRUN} sbatch --wait ${DIRRUN}/static.bash ;; -# PBS) -# echo "Rodando em PBS" -# cd ${DIRRUN} -# # comandos qsub, qstat, etc. -# ;; + PBS) + echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Sbatch static.bash...\n" + cd ${DIRRUN} + qsub -W block=true ${DIRRUN}/static.bash + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # cd ${DIRRUN} diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 8870d79..8868ef2 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -116,6 +116,7 @@ fi # NLEVS get from t_iso_levels in Registry_isobaric.xml: if [ -s ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml ] then + chmod 777 ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml NLEV=$(grep "t_iso_levels" ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml | grep definition | cut -d\" -f4) else NLEV=18 @@ -127,7 +128,13 @@ nfiles=$(echo "$FCST/$output_interval + 1" | bc) diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_${YYYYMMDDHHi}.00.00.x${RES}L${N_MODEL_LEV}.nc diag_name_templ=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_%y4%m2%d2%h2.%n2.00.x${RES}L${N_MODEL_LEV}.nc + + rm -fr ${DIRRUN}/qctlinfo.gs +cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} + +chmod 777 ${DATAOUT}/${YYYYMMDDHHi}/Post/* cat > ${DIRRUN}/qctlinfo.gs < ${DIRRUN}/qctlinfo.ctl + +#grads -lbcx "run ${DIRRUN}/qctlinfo.gs" | awk '/dset/,/endvars/' > ${DIRRUN}/qctlinfo.ctl + +chmod 777 ${DIRRUN}/qctlinfo.ctl +read -p "verifcar grads ctl" +ls -ltr ${DIRRUN}/qctlinfo.ctl timectl=$(grep tdef ${DIRRUN}/qctlinfo.ctl | cut -d" " -f4) sed -i '3a\options template' ${DIRRUN}/qctlinfo.ctl sed -i "/tdef/c\tdef ${nfiles} linear ${timectl} ${t_stroutmin}mn" ${DIRRUN}/qctlinfo.ctl sed -i "/dset/c\dset ^${diag_name_templ}" ${DIRRUN}/qctlinfo.ctl +read -p "copiando ctl" +chmod 777 ${DIRRUN}/* +#cp ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl mv ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl rm -fr ${DIRRUN} diff --git a/scripts/namelists/include_fields.diag b/scripts/namelists/include_fields.diag old mode 100644 new mode 100755 diff --git a/scripts/namelists/include_fields.diag.CD-CT b/scripts/namelists/include_fields.diag.CD-CT old mode 100644 new mode 100755 diff --git a/scripts/namelists/include_fields.diag.GCC b/scripts/namelists/include_fields.diag.GCC old mode 100644 new mode 100755 diff --git a/scripts/namelists/include_fields.diag.OPER b/scripts/namelists/include_fields.diag.OPER old mode 100644 new mode 100755 diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics b/scripts/namelists/stream_list.atmosphere.diagnostics old mode 100644 new mode 100755 diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT b/scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT old mode 100644 new mode 100755 diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics.GCC b/scripts/namelists/stream_list.atmosphere.diagnostics.GCC old mode 100644 new mode 100755 diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics.OPER b/scripts/namelists/stream_list.atmosphere.diagnostics.OPER old mode 100644 new mode 100755 diff --git a/scripts/namelists/stream_list.atmosphere.output b/scripts/namelists/stream_list.atmosphere.output old mode 100644 new mode 100755 diff --git a/scripts/namelists/stream_list.atmosphere.surface b/scripts/namelists/stream_list.atmosphere.surface old mode 100644 new mode 100755 diff --git a/scripts/setenv.bash b/scripts/setenv.bash index f8afde6..2154268 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -49,14 +49,33 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/p/home/carlos.souza/monan/scripts_CD-CT/sources/MONAN-Model_1.4.2-rc +export MONANDIR=/p/scratchin/sylvio.neto/scripts_CD-CT/sources/MONAN-Model_1.4.2-rc +export stools=/p/scratchin/sylvio.neto/scripts_CD-CT/scripts/stools +echo "dir dados = "${DIR_DADOS} +echo "" +echo "dir scripts = "${DIR_SCRIPTS} + # Load your systm setenv: -. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEY}.bash +#. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEY}.bash + +read -p "exportando setenv correto" +echo "" +. ${stools}/setenv_${SYSTEM_KEY}.bash + + + + + + + + +echo "" +module list #----------------------------------------------------------------------- # We discourage changing the variables below: diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 6821096..0fa462b 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -1,21 +1,24 @@ #!/bin/bash # Load modules: - module purge -module load PrgEnv-gnu -module load cray-netcdf -module load cray-parallel-netcdf -module load grads/2.2.1 -#module load metis ??? - +module load PrgEnv-intel +module load craype-x86-turin +module load cray-hdf5/1.14.3.3 +module load cray-netcdf/4.9.0.15 +module load cray-parallel-netcdf/1.12.3.15 +#module load grads/2.2.1 +module load cdo/2.4.2 +module load METIS/5.1.0 +module load cray-pals module list # Submiting variables: # PRE-Static phase: -export STATIC_QUEUE="batch" +#export STATIC_QUEUE="batch" +export STATIC_QUEUE="pesqextra" export STATIC_ncores=32 export STATIC_nnodes=1 export STATIC_ncpn=32 @@ -24,7 +27,8 @@ export STATIC_walltime="02:00:00" # PRE-Degrib phase: -export DEGRIB_QUEUE="batch" +#export DEGRIB_QUEUE="batch" +export DEGRIB_QUEUE="pesqextra" export DEGRIB_ncores=1 export DEGRIB_nnodes=1 export DEGRIB_ncpn=1 @@ -33,7 +37,8 @@ export DEGRIB_walltime="02:00:00" # PRE-Init Atmosphere phase: -export INITATMOS_QUEUE="batch" +#export INITATMOS_QUEUE="batch" +export INITATMOS_QUEUE="pesqextra" export INITATMOS_ncores=64 export INITATMOS_nnodes=1 export INITATMOS_ncpn=64 @@ -42,7 +47,8 @@ export INITATMOS_walltime="02:00:00" # Model phase: -export MODEL_QUEUE="batch" +#export MODEL_QUEUE="batch" +export MODEL_QUEUE="pesqextra" export MODEL_ncores=512 export MODEL_nnodes=8 export MODEL_ncpn=64 @@ -51,7 +57,8 @@ export MODEL_walltime="8:00:00" # Post phase: -export POST_QUEUE="batch" +#export POST_QUEUE="batch" +export POST_QUEUE="pesqextra" ### export POST_ncores=1 not used yet export POST_nnodes=1 export POST_ncpn=32 @@ -64,6 +71,25 @@ export NETCDF=${NETCDF_DIR} export PNETCDF=${PNETCDF_DIR} export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/home/monan/dados/MONAN_v1.4.x ###??? +export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x +export OPERDIR=/p/scratchin/${USER}/monan/CIs +#export OPERDIR=/p/oper/dados/ioper/tempo + +export NETCDF=/opt/cray/pe/netcdf/4.9.0.15/INTEL/2023.2 +export PNETCDF=/opt/cray/pe/parallel-netcdf/1.12.3.15/INTEL/2023.2 +# PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL +export PIO= +export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib:$LD_LIBRARY_PATH + + + + + + + + + + +#export DIRDADOS=/p/home/monan/dados/MONAN_v1.4.x ###??? ### ??? export OPERDIR=/oper/dados/ioper/tempo diff --git a/scripts/stools/submit_PBS_ian.bash_TEMPLATE b/scripts/stools/submit_PBS_ian.bash_TEMPLATE new file mode 100755 index 0000000..455ae78 --- /dev/null +++ b/scripts/stools/submit_PBS_ian.bash_TEMPLATE @@ -0,0 +1,12 @@ +#!/bin/bash -x +#PBS -N #JOBNAME# +#PBS -q #PARTITION# +#PBS -l select=#NNODES#:ncpus=#NTASKSPNODE#:mpiprocs=#NTASKSPNODE# +#PBS -l walltime=#WALLTIME# +#PBS -o #OUTPUTJOB#\${PBS_JOBID} +#PBS -e #ERRORJOB#\${PBS_JOBID} +#PBS -l place=excl +#PBS -V + + + diff --git a/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE b/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE index a3f2444..3ffe9a6 100755 --- a/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE +++ b/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE @@ -6,7 +6,7 @@ #SBATCH --tasks-per-node=#NTASKSPNODE# #SBATCH --partition=#PARTITION# #SBATCH --time=#WALLTIME# -#SBATCH --output=#OUTPUTJOB# -#SBATCH --error=#ERRORJOB# +#SBATCH --output=#OUTPUTJOB#%j +#SBATCH --error=#ERRORJOB#%j #SBATCH --exclusive From c782d0642bfdfb71d431a886dd4da051107234dc Mon Sep 17 00:00:00 2001 From: netosylvio Date: Mon, 13 Oct 2025 20:27:40 +0000 Subject: [PATCH 04/72] on833: setenv.bash and stools/setenv_PBS_ian.bash were modified to work with their environment variables from netcdf and pnetcdf libraries --- scripts/0.run_all.bash | 10 +++++----- scripts/setenv.bash | 7 ++++--- scripts/stools/setenv_PBS_ian.bash | 2 -- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 9937124..2402a82 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -40,18 +40,18 @@ EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} # Input variables:----------------------------------------------------- github_link="https://github.com/monanadmin/MONAN-Model.git" -monan_branch=1.4.2-rc +monan_branch=feature/monan-833-NF convertmpas_branch=1.2.0 EXP=GFS RES=1024002 -YYYYMMDDHHi=2024010100 -FCST=3 +YYYYMMDDHHi=2025061600 +FCST=24 #---------------------------------------------------------------------- # STEP 1: Installing and compiling the A-MONAN model and utility programs: -#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} -#exit +time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: #time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 2154268..2f70f8f 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -49,7 +49,7 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/p/scratchin/sylvio.neto/scripts_CD-CT/sources/MONAN-Model_1.4.2-rc +export MONANDIR=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF export stools=/p/scratchin/sylvio.neto/scripts_CD-CT/scripts/stools echo "dir dados = "${DIR_DADOS} echo "" @@ -59,11 +59,12 @@ echo "dir scripts = "${DIR_SCRIPTS} # Load your systm setenv: -#. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEY}.bash +. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEY}.bash + read -p "exportando setenv correto" echo "" -. ${stools}/setenv_${SYSTEM_KEY}.bash +#. ${stools}/setenv_${SYSTEM_KEY}.bash diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 0fa462b..331f47c 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -75,8 +75,6 @@ export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x export OPERDIR=/p/scratchin/${USER}/monan/CIs #export OPERDIR=/p/oper/dados/ioper/tempo -export NETCDF=/opt/cray/pe/netcdf/4.9.0.15/INTEL/2023.2 -export PNETCDF=/opt/cray/pe/parallel-netcdf/1.12.3.15/INTEL/2023.2 # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib:$LD_LIBRARY_PATH From 34949e57223f97de1f1ec86d73553d59a57dddfb Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 14 Oct 2025 14:16:33 +0000 Subject: [PATCH 05/72] on #833: first testing in my area --- scripts/1.install_monan.bash | 22 +++------------------- scripts/setenv.bash | 18 +++--------------- scripts/stools/setenv_PBS_ian.bash | 19 ++----------------- 3 files changed, 8 insertions(+), 51 deletions(-) mode change 100755 => 100644 scripts/setenv.bash diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 9fe065e..990358c 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -69,7 +69,6 @@ fi echo "" echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash - echo "" echo "---- Installing the Model ----" echo "" @@ -169,6 +168,7 @@ cat << EOF > make-all.sh # gfortran # xlf # pgi +# intel-xd2000 :: cptec/inpe ian xd2000 #Availabe Cores: # atmosphere # init_atmosphere @@ -213,13 +213,7 @@ MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" echo "fazendo o make atmosphere" read -p "fazendo make atmosphere" make clean CORE=atmosphere -#make -j 8 gfortran CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -echo "compilando o atomosphere" -read -p "compilando o atmosphere" - -make -j 8 intel 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=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} #CR: TODO: put verify here if executable was created ok mv ${MONANDIR}/atmosphere_model ${EXECS} @@ -230,8 +224,7 @@ make clean CORE=atmosphere MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" make clean CORE=init_atmosphere -#make -j 8 gfortran CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} -make -j 8 intel CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +make -j 8 ${MAKE_TARG} CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} @@ -254,22 +247,13 @@ chmod a+x make-all.sh echo "" echo -e "${GREEN}==>${NC} Installing init_atmosphere_model and atmosphere_model...\n" echo "" -read -p "rodando make-all..." . ${MONANDIR}/make-all.sh -read -p "instalando convert mpas" # install convert_mpas echo "" echo -e "${GREEN}==>${NC} Moduling environment for convert_mpas...\n" -#module purge -#module load gnu9/9.4.0 -#module load ohpc -#module load phdf5 -#module load netcdf -#module load netcdf-fortran -module list cd ${CONVERT_MPAS_DIR} echo "" diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100755 new mode 100644 index 2f70f8f..88932cc --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -23,9 +23,11 @@ THOSTNAME=$(hostname -s) case ${THOSTNAME} in egeon-login|headnode) HOSTNAME="egeon" + export MAKE_TARG=gfortran ;; ian[0-9]*) HOSTNAME="ian" + export MAKE_TARG=intel-xd2000 ;; esac export HOSTNAME @@ -49,30 +51,16 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF -export stools=/p/scratchin/sylvio.neto/scripts_CD-CT/scripts/stools +export MONANDIR=/p/scratchin/carlos.souza/issues/833-scrpts-monan-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF echo "dir dados = "${DIR_DADOS} -echo "" echo "dir scripts = "${DIR_SCRIPTS} - # Load your systm setenv: . ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEY}.bash -read -p "exportando setenv correto" -echo "" -#. ${stools}/setenv_${SYSTEM_KEY}.bash - - - - - - - - echo "" diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 331f47c..4cce080 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -17,7 +17,6 @@ module list # Submiting variables: # PRE-Static phase: -#export STATIC_QUEUE="batch" export STATIC_QUEUE="pesqextra" export STATIC_ncores=32 export STATIC_nnodes=1 @@ -27,7 +26,6 @@ export STATIC_walltime="02:00:00" # PRE-Degrib phase: -#export DEGRIB_QUEUE="batch" export DEGRIB_QUEUE="pesqextra" export DEGRIB_ncores=1 export DEGRIB_nnodes=1 @@ -37,7 +35,6 @@ export DEGRIB_walltime="02:00:00" # PRE-Init Atmosphere phase: -#export INITATMOS_QUEUE="batch" export INITATMOS_QUEUE="pesqextra" export INITATMOS_ncores=64 export INITATMOS_nnodes=1 @@ -47,7 +44,6 @@ export INITATMOS_walltime="02:00:00" # Model phase: -#export MODEL_QUEUE="batch" export MODEL_QUEUE="pesqextra" export MODEL_ncores=512 export MODEL_nnodes=8 @@ -57,7 +53,6 @@ export MODEL_walltime="8:00:00" # Post phase: -#export POST_QUEUE="batch" export POST_QUEUE="pesqextra" ### export POST_ncores=1 not used yet export POST_nnodes=1 @@ -71,9 +66,8 @@ export NETCDF=${NETCDF_DIR} export PNETCDF=${PNETCDF_DIR} export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x -export OPERDIR=/p/scratchin/${USER}/monan/CIs -#export OPERDIR=/p/oper/dados/ioper/tempo +export DIRDADOS=/p/monan/MONAN_v1.4.x +export OPERDIR=/p/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= @@ -82,12 +76,3 @@ export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib:$LD_LIBRARY_PATH - - - - - - -#export DIRDADOS=/p/home/monan/dados/MONAN_v1.4.x ###??? -### ??? export OPERDIR=/oper/dados/ioper/tempo - From fc44a9a3a2fa01f72c6890c624d3f732afcbda25 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 14 Oct 2025 14:37:14 +0000 Subject: [PATCH 06/72] on #833: files permission ajusdtment --- VERSION.txt | 0 scripts.pomerode/group_levels.py | 0 scripts.pomerode/requirements.txt | 0 scripts.pomerode/setenv_python.bash | 0 scripts.sdumont2/group_levels.py | 0 scripts.sdumont2/requirements.txt | 0 scripts.sdumont2/setenv_python.bash | 0 scripts.sdumont2/utils/setenv_libs_and_pio.bash | 0 scripts/1.install_monan.bash | 1 - 9 files changed, 1 deletion(-) mode change 100644 => 100755 VERSION.txt mode change 100644 => 100755 scripts.pomerode/group_levels.py mode change 100644 => 100755 scripts.pomerode/requirements.txt mode change 100644 => 100755 scripts.pomerode/setenv_python.bash mode change 100644 => 100755 scripts.sdumont2/group_levels.py mode change 100644 => 100755 scripts.sdumont2/requirements.txt mode change 100644 => 100755 scripts.sdumont2/setenv_python.bash mode change 100644 => 100755 scripts.sdumont2/utils/setenv_libs_and_pio.bash diff --git a/VERSION.txt b/VERSION.txt old mode 100644 new mode 100755 diff --git a/scripts.pomerode/group_levels.py b/scripts.pomerode/group_levels.py old mode 100644 new mode 100755 diff --git a/scripts.pomerode/requirements.txt b/scripts.pomerode/requirements.txt old mode 100644 new mode 100755 diff --git a/scripts.pomerode/setenv_python.bash b/scripts.pomerode/setenv_python.bash old mode 100644 new mode 100755 diff --git a/scripts.sdumont2/group_levels.py b/scripts.sdumont2/group_levels.py old mode 100644 new mode 100755 diff --git a/scripts.sdumont2/requirements.txt b/scripts.sdumont2/requirements.txt old mode 100644 new mode 100755 diff --git a/scripts.sdumont2/setenv_python.bash b/scripts.sdumont2/setenv_python.bash old mode 100644 new mode 100755 diff --git a/scripts.sdumont2/utils/setenv_libs_and_pio.bash b/scripts.sdumont2/utils/setenv_libs_and_pio.bash old mode 100644 new mode 100755 diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 990358c..fde0e99 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -159,7 +159,6 @@ echo "" echo -e "${GREEN}==>${NC} Making compile script...\n" cd $MONANDIR -read -p "escrevendo o make-all" cat << EOF > make-all.sh #!/bin/bash #Usage: make target CORE=[core] [options] From 8125f8cae91c67b85416ec6eb699d98573f4f5dc Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 14 Oct 2025 14:39:33 +0000 Subject: [PATCH 07/72] on #833: file stenv.bash permission double check --- scripts/setenv.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/setenv.bash diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100644 new mode 100755 From 10b862e7faa2c6d8ebfc47c1107f2780b66afd83 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Tue, 14 Oct 2025 17:08:05 +0000 Subject: [PATCH 08/72] on #833: adjusting DIR_SCRIPTS and MONANDIR variables with the sed command. --- scripts/1.install_monan.bash | 28 ++++++++++++++++++---------- scripts/setenv.bash | 24 +++++------------------- 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index fde0e99..2ae3ac5 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -45,7 +45,7 @@ function checkout_system() { echo -e "${RED}==>${NC} Please check if you have this branch. Exiting ..." exit -1 fi - git log -1 --name-only + git log | head -1 } #-----------------------------------------------------------------------------# @@ -69,6 +69,7 @@ fi echo "" echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash + echo "" echo "---- Installing the Model ----" echo "" @@ -97,9 +98,12 @@ echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" # Local variables:----------------------------------------------------- +DIR_SCRIPTS=${SCRIPTS} MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} +$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$DIR_SCRIPTS;" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) +chmod 755 setenv.bash #---------------------------------------------------------------------- #===================================================================================== @@ -159,6 +163,7 @@ echo "" echo -e "${GREEN}==>${NC} Making compile script...\n" cd $MONANDIR + cat << EOF > make-all.sh #!/bin/bash #Usage: make target CORE=[core] [options] @@ -167,7 +172,6 @@ cat << EOF > make-all.sh # gfortran # xlf # pgi -# intel-xd2000 :: cptec/inpe ian xd2000 #Availabe Cores: # atmosphere # init_atmosphere @@ -208,11 +212,10 @@ export PNETCDF=${PNETCDFDIR} export PIO= MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" - -echo "fazendo o make atmosphere" -read -p "fazendo make 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 gfortran CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +make -j 8 intel-xd2000 CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} + #CR: TODO: put verify here if executable was created ok mv ${MONANDIR}/atmosphere_model ${EXECS} @@ -223,7 +226,8 @@ make clean CORE=atmosphere MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" make clean CORE=init_atmosphere -make -j 8 ${MAKE_TARG} CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +#make -j 8 gfortran CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +make -j 8 intel-xd2000 CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} @@ -253,11 +257,15 @@ echo "" # install convert_mpas echo "" echo -e "${GREEN}==>${NC} Moduling environment for convert_mpas...\n" +#module purge +#module load gnu9/9.4.0 +#module load ohpc +#module load phdf5 +#module load netcdf +#module load netcdf-fortran +module list cd ${CONVERT_MPAS_DIR} -echo "" -echo -e "${GREEN}==>${NC} Installing convert_mpas...\n" -read -p "aperte enter para instalar convert mpas" make clean make 2>&1 | tee make.convert.output diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 88932cc..2052685 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,7 +1,5 @@ #!/bin/bash - - # Squeduler detect: if command -v sbatch &> /dev/null then @@ -23,16 +21,13 @@ THOSTNAME=$(hostname -s) case ${THOSTNAME} in egeon-login|headnode) HOSTNAME="egeon" - export MAKE_TARG=gfortran ;; ian[0-9]*) HOSTNAME="ian" - export MAKE_TARG=intel-xd2000 ;; esac export HOSTNAME - # Make the same for other machines/systems... echo "Host detected: $HOSTNAME" @@ -40,32 +35,23 @@ echo "Host detected: $HOSTNAME" export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" - - - - # Set environment variables and importants directories-------------------------------------------------- # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) +export DIR_SCRIPTS=$DIR_SCRIPTS export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/p/scratchin/carlos.souza/issues/833-scrpts-monan-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF -echo "dir dados = "${DIR_DADOS} -echo "dir scripts = "${DIR_SCRIPTS} - - -# Load your systm setenv: - -. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEY}.bash - +export MONANDIR=$MONANDIR +# Load your system setenv: +. ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash echo "" module list + #----------------------------------------------------------------------- # We discourage changing the variables below: From 1f79eddb8d241a8ca4a0df4c64dee833f15c130d Mon Sep 17 00:00:00 2001 From: egkhamis Date: Tue, 14 Oct 2025 17:18:03 +0000 Subject: [PATCH 09/72] on #833: fixing merge problems. --- scripts/1.install_monan.bash | 17 +++-------------- scripts/setenv.bash | 10 +++++++++- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 2ae3ac5..83840c3 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -69,7 +69,6 @@ fi echo "" echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash - echo "" echo "---- Installing the Model ----" echo "" @@ -163,7 +162,6 @@ echo "" echo -e "${GREEN}==>${NC} Making compile script...\n" cd $MONANDIR - cat << EOF > make-all.sh #!/bin/bash #Usage: make target CORE=[core] [options] @@ -172,6 +170,7 @@ cat << EOF > make-all.sh # gfortran # xlf # pgi +# intel-xd2000 :: cptec/inpe ian xd2000 #Availabe Cores: # atmosphere # init_atmosphere @@ -213,9 +212,7 @@ export PIO= MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" make clean CORE=atmosphere -#make -j 8 gfortran CORE=atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} -make -j 8 intel-xd2000 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=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} #CR: TODO: put verify here if executable was created ok mv ${MONANDIR}/atmosphere_model ${EXECS} @@ -226,8 +223,7 @@ make clean CORE=atmosphere MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" make clean CORE=init_atmosphere -#make -j 8 gfortran CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} -make -j 8 intel-xd2000 CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} +make -j 8 ${MAKE_TARG} CORE=init_atmosphere OPENMP=true USE_PIO2=false PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} @@ -257,13 +253,6 @@ echo "" # install convert_mpas echo "" echo -e "${GREEN}==>${NC} Moduling environment for convert_mpas...\n" -#module purge -#module load gnu9/9.4.0 -#module load ohpc -#module load phdf5 -#module load netcdf -#module load netcdf-fortran -module list cd ${CONVERT_MPAS_DIR} make clean diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 2052685..7a6cd97 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,5 +1,7 @@ #!/bin/bash + + # Squeduler detect: if command -v sbatch &> /dev/null then @@ -21,13 +23,16 @@ THOSTNAME=$(hostname -s) case ${THOSTNAME} in egeon-login|headnode) HOSTNAME="egeon" + export MAKE_TARG=gfortran ;; ian[0-9]*) HOSTNAME="ian" + export MAKE_TARG=intel-xd2000 ;; esac export HOSTNAME + # Make the same for other machines/systems... echo "Host detected: $HOSTNAME" @@ -35,6 +40,10 @@ echo "Host detected: $HOSTNAME" export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" + + + + # Set environment variables and importants directories-------------------------------------------------- @@ -51,7 +60,6 @@ export MONANDIR=$MONANDIR echo "" module list - #----------------------------------------------------------------------- # We discourage changing the variables below: From c955ea82f807cdb0c30c8b28722eb5f884e4ad17 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 14 Oct 2025 19:49:43 +0000 Subject: [PATCH 10/72] on #833: I threw out some comments I got the data path right I stopped debugging make_static.bash, be careful because there are exits written in the code at the point where I stopped. --- scripts/0.run_all.bash | 8 +++---- scripts/1.install_monan.bash | 2 +- scripts/2.pre_processing.bash | 25 +++++++------------- scripts/make_static.bash | 26 +++++++-------------- scripts/setenv.bash | 9 ++++--- scripts/stools/setenv_PBS_ian.bash | 5 ++-- scripts/stools/submit_PBS_ian.bash_TEMPLATE | 7 ++++-- 7 files changed, 34 insertions(+), 48 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 2402a82..1333e8a 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -50,12 +50,12 @@ FCST=24 # STEP 1: Installing and compiling the A-MONAN model and utility programs: -time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} -exit +#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +#exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#exit +time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +exit # STEP 3: Executing the Model run: #time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 83840c3..fa89cfc 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -102,7 +102,7 @@ MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} $(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$DIR_SCRIPTS;" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) -chmod 755 setenv.bash +chmod 755 ${SCRIPTS}/setenv.bash #---------------------------------------------------------------------- #===================================================================================== diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index e10cc48..19f8734 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -46,9 +46,6 @@ echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash -read -p "carregando variaveis de ambiente" - - echo "" echo "---- Pre Processing ----" echo "" @@ -89,19 +86,16 @@ echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" git log | head -1 -case "${SYSTEM_KEY}" in - SLURM_egeon) - echo -e "${GREEN}==>${NC} copying and linking fixed input data... \n" - mkdir -p ${DATAIN} - rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} - rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} - ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - ;; -esac +echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" +mkdir -p ${DATAIN} +rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} +rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} +ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + -read -p "fazendo o make static" # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- +rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc 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" @@ -110,8 +104,7 @@ else echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n" fi #---------------------------------------------------------------------------------- - -read -p "fazendo degrib do gfs" +exit # Degrib phase:--------------------------------------------------------------------- @@ -121,8 +114,6 @@ echo -e "${GREEN}==>${NC} Running Degrib:\n" -read -p "fazendo o init atmosphere" - # Init Atmosphere phase:------------------------------------------------------------ echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 27f698c..821a5ff 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x if [ $# -ne 4 ] @@ -90,12 +90,12 @@ do fi done + cp -f ${DATAIN}/fixed/*.TBL ${DIRRUN} cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ @@ -124,18 +124,8 @@ then else echo "#!/bin/bash " > ${DIRRUN}/static.bash fi -chmod 755 ${DIRRUN}/* -cat << EOF0 >> ${DIRRUN}/static.bash -#!/bin/bash -x -#PBS -N ${STATIC_jobname} -#PBS -l select=${STATIC_nnodes}:ncpus=${STATIC_ncores} -#PBS -q ${STATIC_QUEUE} -#PBS -l walltime=${STATIC_walltime} -#PBS -o ${DATAOUT}/logs/static.bash.o${PBS_JOBID} -#PBS -e ${DATAOUT}/logs/static.bash.e${PBS_JOBID} -#PBS -l place=excl -##PBS -l mem=500000 +cat << EOF0 >> ${DIRRUN}/static.bash export executable=init_atmosphere_model @@ -145,7 +135,6 @@ ulimit -v unlimited . ${SCRIPTS}/setenv.bash -. ${SCRIPTS}/stools/setenv_PBS_ian.bash cd ${DIRRUN} @@ -153,7 +142,6 @@ cd ${DIRRUN} chmod 777 * date time mpiexec -np ${STATIC_ncores} ./\${executable} -#time mpirun -np ${STATIC_ncores} ./\${executable} date grep "Finished running" log.init_atmosphere.0000.out >& /dev/null @@ -176,7 +164,7 @@ mv log.init_atmosphere.0000.out ${DATAOUT}/logs/log.init_atmosphere.0000.x1.${RE EOF0 chmod a+x ${DIRRUN}/static.bash - +rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc case "${SCHEDULER_SYSTEM}" in SLURM) @@ -199,6 +187,10 @@ esac mv ${DIRRUN}/static.bash ${DATAOUT}/logs/ +mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ +mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ +mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ +mv log.init_atmosphere*err ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] @@ -208,6 +200,6 @@ else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 fi - +exit rm -fr ${DIRRUN} diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 7a6cd97..2692e75 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -22,15 +22,14 @@ THOSTNAME=$(hostname -s) # Identifying several names of the egeon: case ${THOSTNAME} in egeon-login|headnode) - HOSTNAME="egeon" + export HOSTNAME="egeon" export MAKE_TARG=gfortran ;; ian[0-9]*) - HOSTNAME="ian" + export HOSTNAME="ian" export MAKE_TARG=intel-xd2000 ;; esac -export HOSTNAME # Make the same for other machines/systems... @@ -49,9 +48,9 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=$DIR_SCRIPTS +export DIR_SCRIPTS=/p/scratchin/carlos.souza/issues/833-scrpts-monan-ian/scripts_CD-CT/scripts export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=$MONANDIR +export MONANDIR=/p/scratchin/carlos.souza/issues/833-scrpts-monan-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF # Load your system setenv: . ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 4cce080..b5da93e 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -50,7 +50,8 @@ export MODEL_nnodes=8 export MODEL_ncpn=64 export MODEL_jobname="Model.MONAN" export MODEL_walltime="8:00:00" - +#PBS -l select=8:ncpus=64:mpiprocs=64 == 512mpi, 8nodes, 64cpn +#PBS -l select=16:ncpus=64:mpiprocs=64 == 1024mpi, 16nodes, 64cpn # Post phase: export POST_QUEUE="pesqextra" @@ -66,7 +67,7 @@ export NETCDF=${NETCDF_DIR} export PNETCDF=${PNETCDF_DIR} export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/monan/MONAN_v1.4.x +export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR export OPERDIR=/p/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL diff --git a/scripts/stools/submit_PBS_ian.bash_TEMPLATE b/scripts/stools/submit_PBS_ian.bash_TEMPLATE index 455ae78..1c392bd 100755 --- a/scripts/stools/submit_PBS_ian.bash_TEMPLATE +++ b/scripts/stools/submit_PBS_ian.bash_TEMPLATE @@ -1,10 +1,13 @@ #!/bin/bash -x + +####PBS -l select=:ncpus=:mpiprocs= + #PBS -N #JOBNAME# #PBS -q #PARTITION# #PBS -l select=#NNODES#:ncpus=#NTASKSPNODE#:mpiprocs=#NTASKSPNODE# #PBS -l walltime=#WALLTIME# -#PBS -o #OUTPUTJOB#\${PBS_JOBID} -#PBS -e #ERRORJOB#\${PBS_JOBID} +#PBS -o #OUTPUTJOB# +#PBS -e #ERRORJOB# #PBS -l place=excl #PBS -V From 0902140dc9adb4fef4d77b21b5b8fe04a3b8abd1 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Wed, 15 Oct 2025 00:08:09 +0000 Subject: [PATCH 11/72] on #833: make_degrib.bash adjusted for running at PBS_ian system. --- scripts/2.pre_processing.bash | 6 +- scripts/make_degrib.bash | 137 ++++++++++++++++------------------ 2 files changed, 67 insertions(+), 76 deletions(-) diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 19f8734..f78669d 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -95,7 +95,7 @@ ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- -rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc +####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc 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" @@ -104,12 +104,12 @@ else echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n" fi #---------------------------------------------------------------------------------- -exit + # Degrib phase:--------------------------------------------------------------------- echo -e "${GREEN}==>${NC} Running Degrib:\n" -#time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #---------------------------------------------------------------------------------- diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 843e8df..7e88f64 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -59,12 +59,63 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU mkdir -p ${DATAIN}/${YYYYMMDDHHi} mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -mkdir -p ${HOME}/local/lib64 -cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 -cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 +if [ "$SERVER" = "egeon" ]; then + mkdir -p ${HOME}/local/lib64 + cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 + cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 +fi + +#Se nao existir CI no diretorio do IO, +# busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! +#CR: BNDDIR should be setted just for EGEON machine +#CR: some local variables were mobed into the SLURM section, particularly for egeon +case "${SYSTEM_KEY}" in + SLURM_egeon) + #CR: Here is the place to setup the CI directory into ${BNDDIR} var, + # to find the gfs file: + OPERDIREXP=${OPERDIR}/${EXP} + BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} + GCCCIS=/mnt/beegfs/monan/CIs/${EXP} + ;; + PBS_ian) + #CR: Here is the place to setup the CI directory into ${BNDDIR} var, + # to find the gfs file: + echo "Rodando em PBS" + OPERDIREXP=${OPERDIR}/${EXP} + # BNDDIR= + GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} + if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then + echo "rsync OK!" + else + echo "rsync error!" + echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" + exit 1 + fi + ;; + GENERIC) + #CR: Here is the place to setup the CI directory into ${BNDDIR} var, + # to find the gfs file: + echo "Nenhum gerenciador detectado" + # BNDDIR= + ;; +esac + -read -p "fazendo download do grib" +#CR: maybe this if should belong to the SLURM kind of running... +#if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +#then +# if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +# then +# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" +# echo -e "${RED}==>${NC}Check ${BNDDIR} or." +# echo -e "${RED}==>${NC}Check ${GCCCIS}" +# exit 1 +# else +# BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} +# fi +#fi + #Fazendo download da condicao de contorno if [ "$SERVER" = "egeon" ]; then if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then @@ -95,55 +146,6 @@ if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib fi - -read -p " Condicao de contorno ok em datain (GFS)" - - - - - -# Se nao existir CI no diretorio do IO, -# busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! -#CR: BNDDIR should be setted just for EGEON machine -#CR: some local variables were mobed into the SLURM section, particularly for egeon -#case "${SYSTEM_KEY}" in -# SLURM_egeon) - #CR: Here is the place to setup the CI directory into ${BNDDIR} var, - # to find the gfs file: -# OPERDIREXP=${OPERDIR}/${EXP} -# BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} -# GCCCIS=/mnt/beegfs/monan/CIs/${EXP} -# ;; -# PBS) -# #CR: Here is the place to setup the CI directory into ${BNDDIR} var, -# # to find the gfs file: -# echo "Rodando em PBS" -# # BNDDIR= -# ;; -# GENERIC) -# #CR: Here is the place to setup the CI directory into ${BNDDIR} var, -# # to find the gfs file: -# echo "Nenhum gerenciador detectado" -# # BNDDIR= -# ;; -#esac - -#CR: maybe this if should belong to the SLURM kind of running... -#if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -#then -# if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -# then -# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" -# echo -e "${RED}==>${NC}Check ${BNDDIR} or." -# echo -e "${RED}==>${NC}Check ${GCCCIS}" -# exit 1 -# else -# BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} -# fi -#fi - - - files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") @@ -162,15 +164,13 @@ do fi done -echo "" -read -p "arquivos STATIC, Vtable, ungrib, e GFS ok" -echo "" cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} #cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} @@ -178,12 +178,6 @@ cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash -read -p "arquivos copiados para dirrun)" -ls -ltr ${DIRRUN} -echo "" - -read -p "verificar arquivos em dirun, tem que quer , STATIC // Vtable // ungrib // gfs // namelist.wps // setenv.bash // link_grib //" - if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; @@ -200,18 +194,15 @@ else fi -echo "" -read -p "verificar dirrun" -echo "" cat << EOF0 >> ${DIRRUN}/degrib.bash -#!/bin/bash -x -#PBS -N ${DEGRIB_jobname} -#PBS -l select=${DEGRIB_nnodes}:ncpus=${DEGRIB_ncpn} -#PBS -l walltime=${STATIC_walltime} -#PBS -q ${DEGRIB_QUEUE} -#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o${PBS_JOBID} -#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e${PBS_JOBID} +###!/bin/bash -x +###PBS -N ${DEGRIB_jobname} +###PBS -l select=${DEGRIB_nnodes}:ncpus=${DEGRIB_ncpn} +###PBS -l walltime=${STATIC_walltime} +###PBS -q ${DEGRIB_QUEUE} +###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o${PBS_JOBID} +###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e${PBS_JOBID} # ----------------------------- From a66148a33299a4410e4e4fff33aa500569c37a06 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Wed, 15 Oct 2025 00:35:24 +0000 Subject: [PATCH 12/72] on #833: make_initatmos.bash adjusted for running at PBS_ian system. --- scripts/2.pre_processing.bash | 4 ++-- scripts/make_initatmos.bash | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index f78669d..7f85d28 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -104,12 +104,12 @@ else echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n" fi #---------------------------------------------------------------------------------- - +exit # Degrib phase:--------------------------------------------------------------------- echo -e "${GREEN}==>${NC} Running Degrib:\n" -time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #---------------------------------------------------------------------------------- diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index c3199ef..430ee5a 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -129,15 +129,15 @@ fi cat << EOF0 >> ${DIRRUN}/initatmos.bash -#!/bin/bash -x -#PBS -N ${INITATMOS_jobname} -#PBS -l select=${INITATMOS_nnodes}:ncpus=${INITATMOS_ncores} -#PBS -q ${INITATMOS_QUEUE} -#PBS -l walltime=${STATIC_walltime} -#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o${PBS_JOBID} -#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e${PBS_JOBID} -#PBS -l place=excl -##PBS -l mem=500000 +###!/bin/bash -x +###PBS -N ${INITATMOS_jobname} +###PBS -l select=${INITATMOS_nnodes}:ncpus=${INITATMOS_ncores} +###PBS -q ${INITATMOS_QUEUE} +###PBS -l walltime=${STATIC_walltime} +###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o${PBS_JOBID} +###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e${PBS_JOBID} +###PBS -l place=excl +####PBS -l mem=500000 From 04ea4e03d65eec6ade6eac60f3e0fcad58738ee0 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Wed, 15 Oct 2025 01:47:56 +0000 Subject: [PATCH 13/72] on #833: removing exit command in run_model.bash --- scripts/3.run_model.bash | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index c1aebe3..a7cbf6e 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -233,7 +233,6 @@ case "${SCHEDULER_SYSTEM}" in echo "Rodando em PBS" echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" cd ${DIRRUN} - exit qsub -W block=true ${DIRRUN}/model.bash ;; # GENERIC) From 46d21e2af02013542fddc1c6bbaf51e2efe1e83b Mon Sep 17 00:00:00 2001 From: egkhamis Date: Wed, 15 Oct 2025 11:12:52 +0000 Subject: [PATCH 14/72] on #833: run_post.bash adjusted for running at PBS_ian system. make_template.bash needs to be fixed and the dir run.data removed at the end. --- scripts/4.run_post.bash | 52 ++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 29 deletions(-) diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 26ecb80..a4ae135 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -130,7 +130,6 @@ do fi done -read -p "arquivos ok" # Captura quantos arquivos do modelo tiverem para serem pos-processados e # quando nos serao necessarios para executar ${maxpostpernode} convert_mpas por no: @@ -165,7 +164,7 @@ do done cd ${DIRRUN} -chmod 777 * +chmod 755 ${DIRRUN}/* # Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: node=1 @@ -192,21 +191,21 @@ do fi cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh -#!/bin/bash -x -#PBS -N MO.Pos${node} -#PBS -q ${POST_QUEUE} +####!/bin/bash -x +###PBS -N MO.Pos${node} +###PBS -q ${POST_QUEUE} #PBS -l select=1:ncpus=1:mpiprocs=1 -#PBS -l walltime=${POST_walltime} -#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} -#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} -#PBS -l place=excl -#PBS -V +###PBS -l walltime=${POST_walltime} +###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} +###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} +###PBS -l place=excl +###PBS -V cd ${DIRRUN} . ${SCRIPTS}/setenv.bash . ${SCRIPTS}/stools/setenv_PBS_ian.bash -chmod 777 * +chmod 755 ${DIRRUN}/* echo "Executing posts ${inicio} to ${fim} in node Node ${node}." @@ -225,7 +224,7 @@ do i=\$(printf "%04d" \${ii}) echo "Executing post \${i}" cd ${DIRRUN}/dir.\${i} - chmod 777 * + chmod 755 * hh=${YYYYMMDDHHi:8:2} currentdate=\$(date -d "${YYYYMMDDHHi:0:8} \${hh}:00:00 \$(echo "(\${i}-1)*${t_strout:0:2}" | bc) hours \$(echo "(\${i}-1)*${t_strout:3:2}" | bc) minutes \$(echo "(\${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") diag_name=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc @@ -254,7 +253,7 @@ do done wait - + EOSH chmod a+x ${DIRRUN}/PostAtmos_node.${node}.sh @@ -273,7 +272,6 @@ EOSH echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} echo "executando qsub pegando jobid" - read -p "tecle enter" jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) ;; # GENERIC) @@ -325,14 +323,14 @@ fi cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh -#!/bin/bash -#PBS -N MO.Pos${node} -#PBS -q ${POST_QUEUE} +###!/bin/bash +###PBS -N MO.Pos${node} +###PBS -q ${POST_QUEUE} #PBS -l select=1:ncpus=1:mpiprocs=1 -#PBS -l walltime=${POST_walltime} -#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} -#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} -#PBS -V +###PBS -l walltime=${POST_walltime} +###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} +###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} +###PBS -V cd ${DIRRUN} @@ -351,8 +349,8 @@ cp -f ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/* ${DATAOUT}/${YYYYMMDDHHi}/Post/logs cp -f ${DATAOUT}/${YYYYMMDDHHi}/Model/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Post/logs -cd ${DIRRUN}/.. -rm -fr ${DIRRUN} +####cd ${DIRRUN}/.. +####rm -fr ${DIRRUN} EOSH @@ -368,7 +366,6 @@ case "${SCHEDULER_SYSTEM}" in echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} echo "submetendo de novo" - read -p "verificar" jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) ;; @@ -380,8 +377,5 @@ esac #CR: passar este scriptpara dentro do script PostAtmos_node.0.sh, submetido. cd ${SCRIPTS} -echo "" -read -p "tudo certo - chamando make template" -echo "" -chmod 777 ${DATAOUT}/${YYYYMMDDHHi}/Post/* -time ${SCRIPTS}/make_template.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Post/* +####time ${SCRIPTS}/make_template.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} From d633f0b960271105b9bff79b3c0280b8368d3603 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Wed, 15 Oct 2025 06:19:43 +0000 Subject: [PATCH 15/72] on833: Lower otimization on makefile (fflags 02) --- scripts/0.run_all.bash | 6 ++--- scripts/1.install_monan.bash | 6 +++++ scripts/2.pre_processing.bash | 39 +++++++++++++++++++++++++++--- scripts/make_degrib.bash | 30 ++++++----------------- scripts/make_initatmos.bash | 19 +++------------ scripts/make_static.bash | 24 +++++++++++++++--- scripts/setenv.bash | 25 ++++++++++++------- scripts/stools/setenv_PBS_ian.bash | 12 +++++++-- 8 files changed, 101 insertions(+), 60 deletions(-) mode change 100755 => 100644 scripts/setenv.bash diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 1333e8a..52568a0 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -51,16 +51,14 @@ FCST=24 # STEP 1: Installing and compiling the A-MONAN model and utility programs: #time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} -#exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -exit # STEP 3: Executing the Model run: -#time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #exit # STEP 4: Executing the Post of Model run: -time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} exit diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index fa89cfc..69ebeda 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -211,9 +211,13 @@ export PNETCDF=${PNETCDFDIR} export PIO= 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 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 mv ${MONANDIR}/atmosphere_model ${EXECS} mv ${MONANDIR}/build_tables ${EXECS} @@ -222,9 +226,11 @@ cp ${MONANDIR}/GF_ConvPar_nml ${SCRIPTS} make clean CORE=atmosphere MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" + make clean CORE=init_atmosphere make -j 8 ${MAKE_TARG} CORE=init_atmosphere OPENMP=true USE_PIO2=false 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} diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 7f85d28..9ba25d6 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -85,6 +85,9 @@ echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" #git log -1 --name-only git log | head -1 +echo "" +echo ${SYSTEM_KEY} +echo "" echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" mkdir -p ${DATAIN} @@ -92,8 +95,31 @@ rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - - +read -p "Verificar a copia de datain/fixed // datain/execs // e link do WPS" + +#case "${SYSTEM_KEY}" in +# SLURM_egeon) +# echo -e "${GREEN}==>${NC} copying and linking fixed input data for Egeon... \n" +# mkdir -p ${DATAIN} +# rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} +# rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} +# ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} +# ;; +# PBS_ian) +# echo -e "${GREEN}==>${NC} copying and linking fixed input data for IAN... \n" +# mkdir -p ${DATAIN}/fixed +# rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ +# chmod 775 ${DATAIN}/fixed/* +# #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} +# chmod 775 ${EXECS}/* +# ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} +# ;; + +#esac + + +#rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc +#rm -fr ${DATAOUT}/logs/* # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- ####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc if [ ! -s ${DATAIN}/fixed/x1.${RES}.static.nc ] @@ -104,12 +130,17 @@ else echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n" fi #---------------------------------------------------------------------------------- -exit +#if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} ] +#then # Degrib phase:--------------------------------------------------------------------- echo -e "${GREEN}==>${NC} Running Degrib:\n" -#time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#else +#echo -e "${GREEN}==>${NC} File ${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" +#fi + #---------------------------------------------------------------------------------- diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 7e88f64..944d414 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -117,6 +117,9 @@ esac #fi #Fazendo download da condicao de contorno +echo "server" +echo $HOSTNAME + if [ "$SERVER" = "egeon" ]; then if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -164,7 +167,6 @@ do fi done - cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} @@ -177,6 +179,8 @@ cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash +ls -ltr ${DIRRUN} +echo "" if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then @@ -186,33 +190,14 @@ then s,#NTASKSPNODE#,${DEGRIB_ncpn},g; s,#PARTITION#,${DEGRIB_QUEUE},g; s,#WALLTIME#,${DEGRIB_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o%j,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e%j,g" \ + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib.bash else echo "#!/bin/bash " > ${DIRRUN}/degrib.bash fi - - cat << EOF0 >> ${DIRRUN}/degrib.bash -###!/bin/bash -x -###PBS -N ${DEGRIB_jobname} -###PBS -l select=${DEGRIB_nnodes}:ncpus=${DEGRIB_ncpn} -###PBS -l walltime=${STATIC_walltime} -###PBS -q ${DEGRIB_QUEUE} -###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o${PBS_JOBID} -###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e${PBS_JOBID} - - -# ----------------------------- -# Inicialização do ambiente PBS -# ----------------------------- -#cd $PBS_O_WORKDIR -echo "Rodando no host: $(hostname)" -echo "Diretório de submissão: $PBS_O_WORKDIR" -echo "Nós alocados:" -cat $PBS_NODEFILE ulimit -s unlimited ulimit -c unlimited @@ -314,4 +299,5 @@ do done mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 430ee5a..9e001b1 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -119,27 +119,14 @@ then s,#NTASKSPNODE#,${INITATMOS_ncpn},g; s,#PARTITION#,${INITATMOS_QUEUE},g; s,#WALLTIME#,${INITATMOS_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o%j,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e%j,g" \ + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/initatmos.bash else echo "#!/bin/bash " > ${DIRRUN}/initatmos.bash fi - - cat << EOF0 >> ${DIRRUN}/initatmos.bash -###!/bin/bash -x -###PBS -N ${INITATMOS_jobname} -###PBS -l select=${INITATMOS_nnodes}:ncpus=${INITATMOS_ncores} -###PBS -q ${INITATMOS_QUEUE} -###PBS -l walltime=${STATIC_walltime} -###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o${PBS_JOBID} -###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e${PBS_JOBID} -###PBS -l place=excl -####PBS -l mem=500000 - - export executable=init_atmosphere_model @@ -196,5 +183,5 @@ then echo -e "${RED}==>${NC} Exiting script. \n" exit -1 fi - +chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 821a5ff..008d2fc 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -57,6 +57,7 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU + if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] then if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] @@ -77,6 +78,9 @@ then chmod 777 * fi +#Removendo o arquivo static destargeadodo ucar +rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc + files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC" "${SCRIPTS}/namelists/streams.init_atmosphere.STATIC") @@ -94,9 +98,16 @@ done cp -f ${DATAIN}/fixed/*.TBL ${DIRRUN} cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} + +#comentar as linhas de baixo e descomentar a copia de tudo caso nao funcione cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} +#descomentar a linha de baixo e comentar as duas de cima caso nao funcione // copiado tambem setenv_pbs_ian +#cp -f ${DATAIN}/fixed/x1.${RES}* ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} + + sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ > ${DIRRUN}/namelist.init_atmosphere @@ -118,13 +129,15 @@ then s,#NTASKSPNODE#,${STATIC_ncpn},g; s,#PARTITION#,${STATIC_QUEUE},g; s,#WALLTIME#,${STATIC_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/logs/static.bash.o%j,g; - s,#ERRORJOB#,${DATAOUT}/logs/static.bash.e%j,g" \ + s,#OUTPUTJOB#,${DATAOUT}/logs/static.bash.o,g; + s,#ERRORJOB#,${DATAOUT}/logs/static.bash.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/static.bash else echo "#!/bin/bash " > ${DIRRUN}/static.bash fi +chmod 755 ${DIRRUN}/* + cat << EOF0 >> ${DIRRUN}/static.bash export executable=init_atmosphere_model @@ -141,7 +154,10 @@ cd ${DIRRUN} chmod 777 * date -time mpiexec -np ${STATIC_ncores} ./\${executable} + +#time mpiexec -np ${STATIC_ncores} ./\${executable} +time mpirun -np ${STATIC_ncores} ./\${executable} + date grep "Finished running" log.init_atmosphere.0000.out >& /dev/null @@ -166,6 +182,7 @@ EOF0 chmod a+x ${DIRRUN}/static.bash rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc + case "${SCHEDULER_SYSTEM}" in SLURM) echo -e "${GREEN}==>${NC} Sbatch static.bash...\n" @@ -196,6 +213,7 @@ mv log.init_atmosphere*err ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] then mv ${DIRRUN}/x1.${RES}.static.nc ${DATAIN}/fixed + chmod 777 ${DATAIN}/fixed/* else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100755 new mode 100644 index 2692e75..e8af528 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -39,25 +39,31 @@ echo "Host detected: $HOSTNAME" export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" - - - - # Set environment variables and importants directories-------------------------------------------------- - # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=/p/scratchin/carlos.souza/issues/833-scrpts-monan-ian/scripts_CD-CT/scripts +export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/p/scratchin/carlos.souza/issues/833-scrpts-monan-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export MONANDIR=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF + +export stools=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts/stools + +echo "dir dados = "${DIR_DADOS} +echo "" +echo "dir scripts = "${DIR_SCRIPTS} + # Load your system setenv: -. ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash +#. ${stools}/setenv_${SYSTEM_KEY}.bash + +. ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash -echo "" module list +echo "" +read -p "mostrando modulos carregados" + #----------------------------------------------------------------------- # We discourage changing the variables below: @@ -71,6 +77,7 @@ export MPI_PARAMS="-iface ib0 -bind-to core -map-by core" # Colors: +# export GREEN='\033[1;32m' # Green export RED='\033[1;31m' # Red export NC='\033[0m' # No Color diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index b5da93e..b2c2539 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -3,6 +3,7 @@ # Load modules: module purge module load PrgEnv-intel +module load intel/2025.0 module load craype-x86-turin module load cray-hdf5/1.14.3.3 module load cray-netcdf/4.9.0.15 @@ -67,8 +68,15 @@ export NETCDF=${NETCDF_DIR} export PNETCDF=${PNETCDF_DIR} export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR -export OPERDIR=/p/monan/CIs + + +#export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR +#export OPERDIR=/p/monan/CIs + +export DIRDADOS=/p/monan/dados/MONAN_v1.4.x +#export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x + +export OPERDIR=/p/scratchin/${USER}/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= From 445e8c1b3a53a3208d72284a7d52f261c4e8dc73 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Wed, 15 Oct 2025 17:15:48 +0000 Subject: [PATCH 16/72] on833: adjusts after pull --- scripts/0.run_all.bash | 3 +- scripts/2.pre_processing.bash | 54 +++++++++++++++++------------------ scripts/make_static.bash | 2 +- scripts/setenv.bash | 2 +- 4 files changed, 30 insertions(+), 31 deletions(-) mode change 100644 => 100755 scripts/setenv.bash diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 52568a0..d8c1d7e 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -50,14 +50,13 @@ FCST=24 # STEP 1: Installing and compiling the A-MONAN model and utility programs: -#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} # STEP 3: Executing the Model run: time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#exit # STEP 4: Executing the Post of Model run: #time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 9ba25d6..45329cc 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -89,33 +89,33 @@ echo "" echo ${SYSTEM_KEY} echo "" -echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" -mkdir -p ${DATAIN} -rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - -read -p "Verificar a copia de datain/fixed // datain/execs // e link do WPS" - -#case "${SYSTEM_KEY}" in -# SLURM_egeon) -# echo -e "${GREEN}==>${NC} copying and linking fixed input data for Egeon... \n" -# mkdir -p ${DATAIN} -# rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -# rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -# ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} -# ;; -# PBS_ian) -# echo -e "${GREEN}==>${NC} copying and linking fixed input data for IAN... \n" -# mkdir -p ${DATAIN}/fixed -# rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ -# chmod 775 ${DATAIN}/fixed/* -# #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} -# chmod 775 ${EXECS}/* -# ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} -# ;; - -#esac +#echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" +#mkdir -p ${DATAIN} +#rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} +#rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} +#ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + +#read -p "Verificar a copia de datain/fixed // datain/execs // e link do WPS" + +case "${SYSTEM_KEY}" in + SLURM_egeon) + echo -e "${GREEN}==>${NC} copying and linking fixed input data for Egeon... \n" + mkdir -p ${DATAIN} + rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} + rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} + ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + ;; + PBS_ian) + echo -e "${GREEN}==>${NC} copying and linking fixed input data for IAN... \n" + mkdir -p ${DATAIN}/fixed + rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ + chmod 775 ${DATAIN}/fixed/* + #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} + chmod 775 ${EXECS}/* + ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + ;; + +esac #rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 008d2fc..c46a4bb 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -1,4 +1,4 @@ -#!/bin/bash -x +#!/bin/bash if [ $# -ne 4 ] diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100644 new mode 100755 index e8af528..a30605a --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -43,7 +43,7 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) +export DIR_SCRIPTS=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts export DIR_DADOS=$(dirname $(dirname $(pwd))) export MONANDIR=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF From 27a72409591a55f60d6103b61949fbd30316a528 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Wed, 15 Oct 2025 23:39:50 +0000 Subject: [PATCH 17/72] on833 adjusting files and tests --- scripts/0.run_all.bash | 11 ++++++----- scripts/1.install_monan.bash | 2 +- scripts/2.pre_processing.bash | 11 ++++++----- scripts/4.run_post.bash | 2 +- scripts/make_static.bash | 12 ++++++------ scripts/setenv.bash | 2 ++ scripts/stools/setenv_PBS_ian.bash | 4 ++-- 7 files changed, 24 insertions(+), 20 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index d8c1d7e..28d4e69 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -45,19 +45,20 @@ convertmpas_branch=1.2.0 EXP=GFS RES=1024002 YYYYMMDDHHi=2025061600 -FCST=24 +#FCST=24 +FCST=6 #---------------------------------------------------------------------- # STEP 1: Installing and compiling the A-MONAN model and utility programs: -time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} # STEP 3: Executing the Model run: -time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} # STEP 4: Executing the Post of Model run: -#time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} exit diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 69ebeda..111b4d6 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -228,7 +228,7 @@ make clean CORE=atmosphere MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" make clean CORE=init_atmosphere -make -j 8 ${MAKE_TARG} 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=false 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} diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 45329cc..3c1588b 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -111,6 +111,7 @@ case "${SYSTEM_KEY}" in rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ chmod 775 ${DATAIN}/fixed/* #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} + cp -f /p/monan/dados/MONAN_v1.4.x-CR/MONAN_datain/execs/ungrib.exe ${EXECS} chmod 775 ${EXECS}/* ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} ;; @@ -122,13 +123,13 @@ esac #rm -fr ${DATAOUT}/logs/* # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- ####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc -if [ ! -s ${DATAIN}/fixed/x1.${RES}.static.nc ] -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" +#fi #---------------------------------------------------------------------------------- diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index a4ae135..8f9b916 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -378,4 +378,4 @@ esac #CR: passar este scriptpara dentro do script PostAtmos_node.0.sh, submetido. cd ${SCRIPTS} chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Post/* -####time ${SCRIPTS}/make_template.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ${SCRIPTS}/make_template.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index c46a4bb..b33680f 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -100,11 +100,11 @@ cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} #comentar as linhas de baixo e descomentar a copia de tudo caso nao funcione -cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} -cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} +#cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} +#cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} #descomentar a linha de baixo e comentar as duas de cima caso nao funcione // copiado tambem setenv_pbs_ian -#cp -f ${DATAIN}/fixed/x1.${RES}* ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}* ${DIRRUN} cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} @@ -202,12 +202,12 @@ case "${SCHEDULER_SYSTEM}" in # ;; esac - +#read -p "movendo arquivos" mv ${DIRRUN}/static.bash ${DATAOUT}/logs/ mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ -mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ -mv log.init_atmosphere*err ${DATAOUT}/logs/ +#mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ +#mv log.init_atmosphere*err ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] diff --git a/scripts/setenv.bash b/scripts/setenv.bash index a30605a..0b2da5a 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -24,10 +24,12 @@ case ${THOSTNAME} in egeon-login|headnode) export HOSTNAME="egeon" export MAKE_TARG=gfortran + export MAKE_TARG2=gfortran ;; ian[0-9]*) export HOSTNAME="ian" export MAKE_TARG=intel-xd2000 + export MAKE_TARG2=intel2-xd2000 ;; esac diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index b2c2539..6cb5633 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -70,10 +70,10 @@ export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -#export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR +export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR #export OPERDIR=/p/monan/CIs -export DIRDADOS=/p/monan/dados/MONAN_v1.4.x +#export DIRDADOS=/p/monan/dados/MONAN_v1.4.x #export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x export OPERDIR=/p/scratchin/${USER}/monan/CIs From b81d734e5c342bd6b399757a5bac476c9cc6ec4c Mon Sep 17 00:00:00 2001 From: netosylvio Date: Thu, 16 Oct 2025 01:26:42 +0000 Subject: [PATCH 18/72] on833 adjusting run post --- scripts/4.run_post.bash | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 8f9b916..856a60f 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -182,8 +182,8 @@ do /#NTASKSPNODE#/d; s/#PARTITION#/${POST_QUEUE}/g; s/#WALLTIME#/${POST_walltime}/g; - s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o%j|g; - s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e%j|g" \ + s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; + s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ ${DIRRUN}/PostAtmos_node.${node}.sh else @@ -191,16 +191,6 @@ do fi cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh -####!/bin/bash -x -###PBS -N MO.Pos${node} -###PBS -q ${POST_QUEUE} -#PBS -l select=1:ncpus=1:mpiprocs=1 -###PBS -l walltime=${POST_walltime} -###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} -###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} -###PBS -l place=excl -###PBS -V - cd ${DIRRUN} . ${SCRIPTS}/setenv.bash @@ -272,7 +262,7 @@ EOSH echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} echo "executando qsub pegando jobid" - jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) + jobid[${node}]=$(qsub -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) ;; # GENERIC) # echo "Nenhum gerenciador detectado" @@ -311,27 +301,15 @@ then /#NTASKSPNODE#/d; s/#PARTITION#/${POST_QUEUE}/g; s/#WALLTIME#/${POST_walltime}/g; - s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o%j|g; - s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e%j|g" \ + s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; + s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ ${DIRRUN}/PostAtmos_node.${node}.sh else echo "#!/bin/bash " > ${DIRRUN}/PostAtmos_node.${node}.sh fi - - - cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh -###!/bin/bash -###PBS -N MO.Pos${node} -###PBS -q ${POST_QUEUE} -#PBS -l select=1:ncpus=1:mpiprocs=1 -###PBS -l walltime=${POST_walltime} -###PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o${PBS_JOBID} -###PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e${PBS_JOBID} -###PBS -V - cd ${DIRRUN} . ${SCRIPTS}/setenv.bash @@ -366,7 +344,7 @@ case "${SCHEDULER_SYSTEM}" in echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} echo "submetendo de novo" - jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) + jobid[${node}]=$(qsub -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) ;; # GENERIC) From adc491c2c1c7f665039eb60f29891595cbf2b962 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 17 Oct 2025 01:17:50 +0000 Subject: [PATCH 19/72] on #833: fixing pre-processing to work in both, PBS and SLURM, systems. --- scripts/2.pre_processing.bash | 53 +++++++++-------------------------- scripts/make_degrib.bash | 5 ++-- scripts/make_static.bash | 24 ++++------------ scripts/setenv.bash | 15 ++++------ 4 files changed, 27 insertions(+), 70 deletions(-) diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 3c1588b..e91149f 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -85,51 +85,24 @@ echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" #git log -1 --name-only git log | head -1 -echo "" -echo ${SYSTEM_KEY} -echo "" -#echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" -#mkdir -p ${DATAIN} -#rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -#rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -#ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - -#read -p "Verificar a copia de datain/fixed // datain/execs // e link do WPS" - -case "${SYSTEM_KEY}" in - SLURM_egeon) - echo -e "${GREEN}==>${NC} copying and linking fixed input data for Egeon... \n" - mkdir -p ${DATAIN} - rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} - rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} - ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - ;; - PBS_ian) - echo -e "${GREEN}==>${NC} copying and linking fixed input data for IAN... \n" - mkdir -p ${DATAIN}/fixed - rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ - chmod 775 ${DATAIN}/fixed/* - #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} - cp -f /p/monan/dados/MONAN_v1.4.x-CR/MONAN_datain/execs/ungrib.exe ${EXECS} - chmod 775 ${EXECS}/* - ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - ;; - -esac - - -#rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc -#rm -fr ${DATAOUT}/logs/* +echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" +mkdir -p ${DATAIN} +rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} +rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} +ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + + + # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- ####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc -#if [ ! -s ${DATAIN}/fixed/x1.${RES}.static.nc ] -#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" +fi #---------------------------------------------------------------------------------- diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 944d414..d2231e1 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -209,7 +209,8 @@ export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 cd ${DIRRUN} . setenv.bash -. setenv_PBS_ian.bash +# remover setenv do ian do dirrun +#. setenv_PBS_ian.bash echo"" echo "listando os modulos" @@ -299,5 +300,5 @@ do done mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index b33680f..f1be402 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -57,7 +57,6 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] then if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] @@ -78,9 +77,6 @@ then chmod 777 * fi -#Removendo o arquivo static destargeadodo ucar -rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc - files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC" "${SCRIPTS}/namelists/streams.init_atmosphere.STATIC") @@ -98,15 +94,8 @@ done cp -f ${DATAIN}/fixed/*.TBL ${DIRRUN} cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} - -#comentar as linhas de baixo e descomentar a copia de tudo caso nao funcione -#cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} -#cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} - -#descomentar a linha de baixo e comentar as duas de cima caso nao funcione // copiado tambem setenv_pbs_ian -cp -f ${DATAIN}/fixed/x1.${RES}* ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} - +cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ @@ -152,7 +141,7 @@ ulimit -v unlimited cd ${DIRRUN} -chmod 777 * +chmod 755 * date #time mpiexec -np ${STATIC_ncores} ./\${executable} @@ -182,7 +171,6 @@ EOF0 chmod a+x ${DIRRUN}/static.bash rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc - case "${SCHEDULER_SYSTEM}" in SLURM) echo -e "${GREEN}==>${NC} Sbatch static.bash...\n" @@ -206,14 +194,14 @@ esac mv ${DIRRUN}/static.bash ${DATAOUT}/logs/ mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ -#mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ -#mv log.init_atmosphere*err ${DATAOUT}/logs/ +mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ +mv log.init_atmosphere*err ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] then mv ${DIRRUN}/x1.${RES}.static.nc ${DATAIN}/fixed - chmod 777 ${DATAIN}/fixed/* + chmod 755 ${DATAIN}/fixed/* else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 0b2da5a..9ff11b1 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -45,11 +45,9 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts +export DIR_SCRIPTS=$(pwd) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF - -export stools=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts/stools +export MONANDIR=$MONANDIR echo "dir dados = "${DIR_DADOS} echo "" @@ -57,14 +55,11 @@ echo "dir scripts = "${DIR_SCRIPTS} # Load your system setenv: - -#. ${stools}/setenv_${SYSTEM_KEY}.bash - . ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash -module list -echo "" -read -p "mostrando modulos carregados" +#module list +#echo "" +#read -p "mostrando modulos carregados" #----------------------------------------------------------------------- From cee1192c25a07b4a42d0ad3115d1accd6ab95f4e Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 17 Oct 2025 00:42:32 -0300 Subject: [PATCH 20/72] on #833: fixing initial conditions finding to work in both, PBS and SLURM, systems. --- scripts/2.pre_processing.bash | 27 +++++++++++++++------------ scripts/make_degrib.bash | 24 +++++++++++++++--------- scripts/make_initatmos.bash | 5 ++--- scripts/make_static.bash | 1 - scripts/stools/setenv_PBS_ian.bash | 7 +++---- 5 files changed, 35 insertions(+), 29 deletions(-) diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index e91149f..89e9774 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -82,7 +82,6 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" -#git log -1 --name-only git log | head -1 @@ -95,7 +94,6 @@ ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- -####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc 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" @@ -106,22 +104,27 @@ fi #---------------------------------------------------------------------------------- -#if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} ] -#then -# Degrib phase:--------------------------------------------------------------------- -echo -e "${GREEN}==>${NC} Running Degrib:\n" -time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#else -#echo -e "${GREEN}==>${NC} File ${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" -#fi +# Degrib phase:--------------------------------------------------------------------- +if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} ] +then + echo -e "${GREEN}==>${NC} Running Degrib:\n" + time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +else + echo -e "${GREEN}==>${NC} File ${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" +fi #---------------------------------------------------------------------------------- # Init Atmosphere phase:------------------------------------------------------------ -echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" -time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ] +then + echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" + time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +else + echo -e "${GREEN}==>${NC} File x1.${RES}.init.nc already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" +fi #---------------------------------------------------------------------------------- diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index d2231e1..70e3d3b 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -59,7 +59,7 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU mkdir -p ${DATAIN}/${YYYYMMDDHHi} mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -if [ "$SERVER" = "egeon" ]; then +if [ "$HOSTNAME" = "egeon" ]; then mkdir -p ${HOME}/local/lib64 cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 @@ -69,20 +69,23 @@ fi # busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! #CR: BNDDIR should be setted just for EGEON machine #CR: some local variables were mobed into the SLURM section, particularly for egeon +echo "system_key=$SYSTEM_KEY" +echo "operdir=$OPERDIR" case "${SYSTEM_KEY}" in SLURM_egeon) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, # to find the gfs file: + echo "Rodando em SLURM" OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - GCCCIS=/mnt/beegfs/monan/CIs/${EXP} + GCCCIS=/mnt/beegfs/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} ;; PBS_ian) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, # to find the gfs file: echo "Rodando em PBS" OPERDIREXP=${OPERDIR}/${EXP} - # BNDDIR= + BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -117,10 +120,12 @@ esac #fi #Fazendo download da condicao de contorno -echo "server" -echo $HOSTNAME - -if [ "$SERVER" = "egeon" ]; then +#a partir daqui a implementacao na Egeon ja falhava.. tentando corrigir +echo "hostname=$HOSTNAME" +echo "operdirexp=$OPERDIREXP" +echo "bnddir=$BNDDIR" +echo "gcccis=$GCCCIS" +if [ "$HOSTNAME" = "egeon" ]; then if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" else @@ -175,7 +180,8 @@ cp -f ${EXECS}/ungrib.exe ${DIRRUN} cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} +# revisar a copia abaixo no xd2000, manter por enquanto para nao quebrar la' +#cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash @@ -224,7 +230,7 @@ rm -f GRIBFILE.* namelist.wps sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps -#read -p "executando o link_grib" + echo "" ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 9e001b1..146ee38 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -136,8 +136,7 @@ ulimit -s unlimited cd ${DIRRUN} -. setenv.bash -. setenv_PBS_ian.bash +. ${SCRIPTS}/setenv.bash echo "" date @@ -183,5 +182,5 @@ then echo -e "${RED}==>${NC} Exiting script. \n" exit -1 fi -chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index f1be402..647d773 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -206,6 +206,5 @@ else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 fi -exit rm -fr ${DIRRUN} diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 6cb5633..4b5d8f7 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -70,13 +70,12 @@ export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR -#export OPERDIR=/p/monan/CIs +export DIRDADOS=/p/monan/dados/MONAN_v1.4.x +export OPERDIR=/oper/dados/ioper/tempo #export DIRDADOS=/p/monan/dados/MONAN_v1.4.x #export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x - -export OPERDIR=/p/scratchin/${USER}/monan/CIs +#export OPERDIR=/p/scratchin/${USER}/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= From b7e60bafe9ffc30d041433afb5919105bf0e0129 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 17 Oct 2025 04:00:26 +0000 Subject: [PATCH 21/72] =?UTF-8?q?=E2=80=9Con?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/3.run_model.bash | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index a7cbf6e..080a596 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -163,7 +163,6 @@ cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} ${DIRRUN}/stream_list.atmosphere.diagnostics cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} @@ -196,8 +195,7 @@ ulimit -v unlimited ulimit -s unlimited cd ${DIRRUN} -. setenv.bash -. setenv_PBS_ian.bash +. ${SCRIPTS}/setenv.bash date From 679c4139e48d44e8cf34a951dcd43c4e15074756 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Fri, 17 Oct 2025 05:59:40 -0300 Subject: [PATCH 22/72] on833 running on egeon and ian --- scripts/0.run_all.bash | 11 ++-- scripts/1.install_monan.bash | 3 ++ scripts/2.pre_processing.bash | 82 +++++++++++++++++++----------- scripts/3.run_model.bash | 3 ++ scripts/4.run_post.bash | 52 +++++++++++-------- scripts/make_degrib.bash | 35 +++++-------- scripts/make_initatmos.bash | 4 +- scripts/make_static.bash | 29 +++++++---- scripts/make_template.bash | 18 +++---- scripts/setenv.bash | 21 +++++--- scripts/stools/setenv_PBS_ian.bash | 5 +- 11 files changed, 159 insertions(+), 104 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 28d4e69..08e2041 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -51,14 +51,19 @@ FCST=6 # STEP 1: Installing and compiling the A-MONAN model and utility programs: -#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} # STEP 3: Executing the Model run: -#time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} # STEP 4: Executing the Post of Model run: time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} + +#volta o dirname +sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=\$(pwd)\ ;" setenv.bash +sed -i "s;MONANDIR=.*$;MONANDIR=\$(pwd)\ ;" setenv.bash + exit diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 111b4d6..91d7595 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -100,8 +100,11 @@ echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" DIR_SCRIPTS=${SCRIPTS} MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} + $(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$DIR_SCRIPTS;" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) + + chmod 755 ${SCRIPTS}/setenv.bash #---------------------------------------------------------------------- diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 89e9774..2670397 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -82,49 +82,73 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" +#git log -1 --name-only git log | head -1 +echo "" +echo ${SYSTEM_KEY} +echo "" -echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" -mkdir -p ${DATAIN} -rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - - - +#echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" +#mkdir -p ${DATAIN} +#rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} +#rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} +#ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + +#read -p "Verificar a copia de datain/fixed // datain/execs // e link do WPS" + +case "${SYSTEM_KEY}" in + SLURM_egeon) + echo -e "${GREEN}==>${NC} copying and linking fixed input data for Egeon... \n" + mkdir -p ${DATAIN} + rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} + rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} + ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + ;; + PBS_ian) + echo -e "${GREEN}==>${NC} copying and linking fixed input data for IAN... \n" + mkdir -p ${DATAIN}/fixed + rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ + chmod 775 ${DATAIN}/fixed/* + #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} + cp -f /p/monan/dados/MONAN_v1.4.x-CR/MONAN_datain/execs/ungrib.exe ${EXECS} + chmod 775 ${EXECS}/* + ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + ;; + +esac + + +#rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc +#rm -fr ${DATAOUT}/logs/* # 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" +####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc +#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" +#fi #---------------------------------------------------------------------------------- - +#if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} ] +#then # Degrib phase:--------------------------------------------------------------------- -if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} ] -then - echo -e "${GREEN}==>${NC} Running Degrib:\n" - time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -else - echo -e "${GREEN}==>${NC} File ${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" -fi +echo -e "${GREEN}==>${NC} Running Degrib:\n" +time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#else +#echo -e "${GREEN}==>${NC} File ${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" +#fi + #---------------------------------------------------------------------------------- # Init Atmosphere phase:------------------------------------------------------------ -if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ] -then - echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" - time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -else - echo -e "${GREEN}==>${NC} File x1.${RES}.init.nc already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" -fi +echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" +time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #---------------------------------------------------------------------------------- diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 080a596..8eda274 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -163,6 +163,7 @@ cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} ${DIRRUN}/stream_list.atmosphere.diagnostics cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} @@ -195,6 +196,8 @@ ulimit -v unlimited ulimit -s unlimited cd ${DIRRUN} +#. setenv.bash +#. setenv_PBS_ian.bash . ${SCRIPTS}/setenv.bash diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 856a60f..649440e 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -153,7 +153,7 @@ do i=$(printf "%04d" ${ii}) mkdir -p ${DIRRUN}/dir.${i} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN}/dir.${i} - cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN}/dir.${i} +# cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN}/dir.${i} cp -f ${SCRIPTS}/namelists/include_fields.diag${VARTABLE} ${DIRRUN}/dir.${i}/include_fields.diag${VARTABLE} cp -f ${DIRRUN}/dir.${i}/include_fields.diag${VARTABLE} ${DIRRUN}/dir.${i}/include_fields sed -e "s,#NISOLEV#,${NLEV},g;s,#NMODELLEV#,${N_MODEL_LEV},g" \ @@ -166,6 +166,10 @@ done cd ${DIRRUN} chmod 755 ${DIRRUN}/* + +echo "scheduler system = " ${SCHEDULER_SYSTEM} +echo "system key = " ${SYSTEM_KEY} +echo "" # Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: node=1 inicio=1 @@ -176,14 +180,14 @@ do if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then - sed -e "s/#JOBNAME#/MO.Pos${node}/g; - s/#NNODES#/1/g; - /#NTASKS#/d; - /#NTASKSPNODE#/d; - s/#PARTITION#/${POST_QUEUE}/g; - s/#WALLTIME#/${POST_walltime}/g; - s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; - s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ + sed -e "s/#JOBNAME#/MO.Pos${node}/g; \ + s/#NNODES#/1/g; \ + /#NTASKS#/d; \ + /#NTASKSPNODE#/d; \ + s/#PARTITION#/${POST_QUEUE}/g; \ + s/#WALLTIME#/${POST_walltime}/g; \ + s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o|g; \ + s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e|g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ ${DIRRUN}/PostAtmos_node.${node}.sh else @@ -194,7 +198,8 @@ cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh cd ${DIRRUN} . ${SCRIPTS}/setenv.bash -. ${SCRIPTS}/stools/setenv_PBS_ian.bash + +#. ${SCRIPTS}/stools/setenv_PBS_ian.bash chmod 755 ${DIRRUN}/* echo "Executing posts ${inicio} to ${fim} in node Node ${node}." @@ -236,7 +241,7 @@ do diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.00.00.x${RES}L${N_MODEL_LEV}.nc cd ${DIRRUN}/dir.\${i} - chmod 777 * + chmod 775 * cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post} >> convert_mpas.output & echo "cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post}" >> convert_mpas.output @@ -246,10 +251,11 @@ wait EOSH + chmod a+x ${DIRRUN}/PostAtmos_node.${node}.sh - chmod 755 ${DIRRUN}/* + chmod 775 ${DIRRUN}/* cp -f ${DIRRUN}/PostAtmos_node.${node}.sh ${DATAOUT}/${YYYYMMDDHHi}/Post/logs - chmod 777 ${DATAOUT}/${YYYYMMDDHHi}/Post/* + chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Post/* case "${SCHEDULER_SYSTEM}" in SLURM) echo "Sbatch PostAtmos_node.${node}.sh" @@ -295,14 +301,14 @@ rm -f ${DIRRUN}/PostAtmos_node.${node}.sh if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then - sed -e "s/#JOBNAME#/MO.Pos${node}/g; - s/#NNODES#/1/g; - /#NTASKS#/d; - /#NTASKSPNODE#/d; - s/#PARTITION#/${POST_QUEUE}/g; - s/#WALLTIME#/${POST_walltime}/g; - s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; - s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ + sed -e "s/#JOBNAME#/MO.Pos${node}/g; \ + s/#NNODES#/1/g; \ + /#NTASKS#/d; \ + /#NTASKSPNODE#/d; \ + s/#PARTITION#/${POST_QUEUE}/g; \ + s/#WALLTIME#/${POST_walltime}/g; \ + s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o|g; \ + s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e|g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ ${DIRRUN}/PostAtmos_node.${node}.sh else @@ -313,7 +319,7 @@ cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh cd ${DIRRUN} . ${SCRIPTS}/setenv.bash -. ${SCRIPTS}/stools/setenv_PBS_ian.bash +#. ${SCRIPTS}/stools/setenv_PBS_ian.bash # Saving important files to the logs directory: cp -f ${EXECS}/CONVMPAS-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Post @@ -334,6 +340,8 @@ cp -f ${DATAOUT}/${YYYYMMDDHHi}/Model/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi EOSH chmod a+x ${DIRRUN}/PostAtmos_node.${node}.sh + + case "${SCHEDULER_SYSTEM}" in SLURM) echo "Sbatch PostAtmos_node.${node}.sh" diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 70e3d3b..0ca33a8 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -69,13 +69,10 @@ fi # busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! #CR: BNDDIR should be setted just for EGEON machine #CR: some local variables were mobed into the SLURM section, particularly for egeon -echo "system_key=$SYSTEM_KEY" -echo "operdir=$OPERDIR" case "${SYSTEM_KEY}" in SLURM_egeon) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, # to find the gfs file: - echo "Rodando em SLURM" OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} GCCCIS=/mnt/beegfs/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} @@ -85,7 +82,7 @@ case "${SYSTEM_KEY}" in # to find the gfs file: echo "Rodando em PBS" OPERDIREXP=${OPERDIR}/${EXP} - BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} + # BNDDIR= GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -120,11 +117,9 @@ esac #fi #Fazendo download da condicao de contorno -#a partir daqui a implementacao na Egeon ja falhava.. tentando corrigir -echo "hostname=$HOSTNAME" -echo "operdirexp=$OPERDIREXP" -echo "bnddir=$BNDDIR" -echo "gcccis=$GCCCIS" +echo "server" +echo $HOSTNAME + if [ "$HOSTNAME" = "egeon" ]; then if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -175,13 +170,15 @@ done cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} -#cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} + +cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} + cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -# revisar a copia abaixo no xd2000, manter por enquanto para nao quebrar la' -#cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} + +cp -f ${SCRIPTS}/stools/setenv_${SCHEDULER_SYSTEM}_${HOSTNAME}.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash @@ -214,14 +211,10 @@ export PMIX_MCA_gds=hash export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 cd ${DIRRUN} -. setenv.bash -# remover setenv do ian do dirrun +#. setenv.bash #. setenv_PBS_ian.bash -echo"" -echo "listando os modulos" -echo "" -module list +. ${SCRIPTS}/setenv.bash ldd ungrib.exe @@ -230,7 +223,7 @@ rm -f GRIBFILE.* namelist.wps sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps - +#read -p "executando o link_grib" echo "" ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 @@ -306,5 +299,5 @@ do done mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* +chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 146ee38..c09153a 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -136,6 +136,8 @@ ulimit -s unlimited cd ${DIRRUN} +#. setenv.bash +#. setenv_PBS_ian.bash . ${SCRIPTS}/setenv.bash echo "" @@ -182,5 +184,5 @@ then echo -e "${RED}==>${NC} Exiting script. \n" exit -1 fi -chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* +chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 647d773..110e06c 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -57,6 +57,7 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU + if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] then if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] @@ -68,16 +69,17 @@ then wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz tar -xzvf x1.${RES}_static.tar.gz - chmod 777 * + chmod 775 * fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz - chmod 777 * + chmod 775 * fi - +#Removendo o arquivo static destargeadodo ucar +rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC" "${SCRIPTS}/namelists/streams.init_atmosphere.STATIC") for file in "${files_needed[@]}" @@ -94,8 +96,15 @@ done cp -f ${DATAIN}/fixed/*.TBL ${DIRRUN} cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} -cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} -cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} + +#comentar as linhas de baixo e descomentar a copia de tudo caso nao funcione +#cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} +#cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} + +#descomentar a linha de baixo e comentar as duas de cima caso nao funcione // copiado tambem setenv_pbs_ian +cp -f ${DATAIN}/fixed/x1.${RES}* ${DIRRUN} +cp -f ${SCRIPTS}/stools/setenv_${SCHEDULER_SYSTEM}_${HOSTNAME}.bash ${DIRRUN} + sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ @@ -141,7 +150,7 @@ ulimit -v unlimited cd ${DIRRUN} -chmod 755 * +chmod 775 * date #time mpiexec -np ${STATIC_ncores} ./\${executable} @@ -171,6 +180,7 @@ EOF0 chmod a+x ${DIRRUN}/static.bash rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc + case "${SCHEDULER_SYSTEM}" in SLURM) echo -e "${GREEN}==>${NC} Sbatch static.bash...\n" @@ -194,17 +204,18 @@ esac mv ${DIRRUN}/static.bash ${DATAOUT}/logs/ mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ -mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ -mv log.init_atmosphere*err ${DATAOUT}/logs/ +#mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ +#mv log.init_atmosphere*err ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] then mv ${DIRRUN}/x1.${RES}.static.nc ${DATAIN}/fixed - chmod 755 ${DATAIN}/fixed/* + chmod 775 ${DATAIN}/fixed/* else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 fi +exit rm -fr ${DIRRUN} diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 8868ef2..8ad934c 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -116,7 +116,7 @@ fi # NLEVS get from t_iso_levels in Registry_isobaric.xml: if [ -s ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml ] then - chmod 777 ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml + chmod 775 ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml NLEV=$(grep "t_iso_levels" ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml | grep definition | cut -d\" -f4) else NLEV=18 @@ -134,7 +134,7 @@ rm -fr ${DIRRUN}/qctlinfo.gs cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} -chmod 777 ${DATAOUT}/${YYYYMMDDHHi}/Post/* +chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Post/* cat > ${DIRRUN}/qctlinfo.gs < ${DIRRUN}/qctlinfo.ctl #grads -lbcx "run ${DIRRUN}/qctlinfo.gs" | awk '/dset/,/endvars/' > ${DIRRUN}/qctlinfo.ctl -chmod 777 ${DIRRUN}/qctlinfo.ctl -read -p "verifcar grads ctl" -ls -ltr ${DIRRUN}/qctlinfo.ctl +chmod 775 ${DIRRUN}/qctlinfo.ctl + + timectl=$(grep tdef ${DIRRUN}/qctlinfo.ctl | cut -d" " -f4) sed -i '3a\options template' ${DIRRUN}/qctlinfo.ctl sed -i "/tdef/c\tdef ${nfiles} linear ${timectl} ${t_stroutmin}mn" ${DIRRUN}/qctlinfo.ctl sed -i "/dset/c\dset ^${diag_name_templ}" ${DIRRUN}/qctlinfo.ctl -read -p "copiando ctl" -chmod 777 ${DIRRUN}/* + +chmod 775 ${DIRRUN}/* #cp ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl mv ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl rm -fr ${DIRRUN} diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 9ff11b1..dc3b8d6 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -21,12 +21,12 @@ THOSTNAME=$(hostname -s) # Identifying several names of the egeon: case ${THOSTNAME} in - egeon-login|headnode) + egeon-login|headnode|n[0-9]|n[1-2][0-9]|n3[0-3]) export HOSTNAME="egeon" export MAKE_TARG=gfortran export MAKE_TARG2=gfortran ;; - ian[0-9]*) + ian[0-9]*|cn-0[0-9][0-9][0-9]) export HOSTNAME="ian" export MAKE_TARG=intel-xd2000 export MAKE_TARG2=intel2-xd2000 @@ -45,9 +45,11 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=$(pwd) +export DIR_SCRIPTS=/mnt/beegfs/sylvio.neto/issues/nova833/scripts_CD-CT/scripts export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=$MONANDIR +export MONANDIR=/mnt/beegfs/sylvio.neto/issues/nova833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF + +#export stools=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts/stools echo "dir dados = "${DIR_DADOS} echo "" @@ -55,12 +57,15 @@ echo "dir scripts = "${DIR_SCRIPTS} # Load your system setenv: -. ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash -#module list -#echo "" -#read -p "mostrando modulos carregados" +#. ${stools}/setenv_${SYSTEM_KEY}.bash + +. ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash +module list +echo "" +read -p "Mostrando modulos carregados - Pressione Enter para continuar.... " +echo "" #----------------------------------------------------------------------- # We discourage changing the variables below: diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 4b5d8f7..a210014 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -70,11 +70,12 @@ export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/monan/dados/MONAN_v1.4.x -export OPERDIR=/oper/dados/ioper/tempo +export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR +export OPERDIR=/p/monan/CIs #export DIRDADOS=/p/monan/dados/MONAN_v1.4.x #export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x + #export OPERDIR=/p/scratchin/${USER}/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL From 3ca40caba029ca2093326acf88e25f6ddcad190d Mon Sep 17 00:00:00 2001 From: netosylvio Date: Fri, 17 Oct 2025 09:06:49 +0000 Subject: [PATCH 23/72] on833 setenv.bash missed --- scripts/setenv.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100755 => 100644 scripts/setenv.bash diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100755 new mode 100644 index dc3b8d6..ce34b36 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -45,9 +45,9 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=/mnt/beegfs/sylvio.neto/issues/nova833/scripts_CD-CT/scripts +export DIR_SCRIPTS=$(pwd) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/mnt/beegfs/sylvio.neto/issues/nova833/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export MONANDIR=$(pwd) #export stools=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts/stools From 4acd27016d28e3a23e2dc4067fd4fe6d1d5602d9 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Fri, 17 Oct 2025 15:09:12 +0000 Subject: [PATCH 24/72] on #833: fix on setenv.bash , 2.pre_processing.bash and make_static.bash --- scripts/2.pre_processing.bash | 15 ++++++++------- scripts/make_static.bash | 23 +++++++---------------- scripts/setenv.bash | 7 ++----- 3 files changed, 17 insertions(+), 28 deletions(-) mode change 100644 => 100755 scripts/setenv.bash diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 2670397..86477b0 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -112,6 +112,7 @@ case "${SYSTEM_KEY}" in chmod 775 ${DATAIN}/fixed/* #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} cp -f /p/monan/dados/MONAN_v1.4.x-CR/MONAN_datain/execs/ungrib.exe ${EXECS} + chmod 775 ${EXECS}/* ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} ;; @@ -122,14 +123,14 @@ esac #rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc #rm -fr ${DATAOUT}/logs/* # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- -####rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc -#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" + +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" +fi #---------------------------------------------------------------------------------- diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 110e06c..79247c8 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -69,18 +69,15 @@ then wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz tar -xzvf x1.${RES}_static.tar.gz - chmod 775 * + chmod 755 * fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz - chmod 775 * + chmod 755 * fi -#Removendo o arquivo static destargeadodo ucar -rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc - files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC" "${SCRIPTS}/namelists/streams.init_atmosphere.STATIC") for file in "${files_needed[@]}" do @@ -97,14 +94,9 @@ cp -f ${DATAIN}/fixed/*.TBL ${DIRRUN} cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} -#comentar as linhas de baixo e descomentar a copia de tudo caso nao funcione -#cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} -#cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} -#descomentar a linha de baixo e comentar as duas de cima caso nao funcione // copiado tambem setenv_pbs_ian -cp -f ${DATAIN}/fixed/x1.${RES}* ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_${SCHEDULER_SYSTEM}_${HOSTNAME}.bash ${DIRRUN} - sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ @@ -150,10 +142,9 @@ ulimit -v unlimited cd ${DIRRUN} -chmod 775 * +chmod 755 * date -#time mpiexec -np ${STATIC_ncores} ./\${executable} time mpirun -np ${STATIC_ncores} ./\${executable} date @@ -205,13 +196,13 @@ mv ${DIRRUN}/static.bash ${DATAOUT}/logs/ mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ #mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ -#mv log.init_atmosphere*err ${DATAOUT}/logs/ +mv log.init_atmosphere*err ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] then mv ${DIRRUN}/x1.${RES}.static.nc ${DATAIN}/fixed - chmod 775 ${DATAIN}/fixed/* + chmod 755 ${DATAIN}/fixed/* else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 diff --git a/scripts/setenv.bash b/scripts/setenv.bash old mode 100644 new mode 100755 index ce34b36..8d4d39c --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -49,7 +49,6 @@ export DIR_SCRIPTS=$(pwd) export DIR_DADOS=$(dirname $(dirname $(pwd))) export MONANDIR=$(pwd) -#export stools=/p/scratchin/sylvio.neto/issues/833/scripts_CD-CT/scripts/stools echo "dir dados = "${DIR_DADOS} echo "" @@ -58,13 +57,11 @@ echo "dir scripts = "${DIR_SCRIPTS} # Load your system setenv: -#. ${stools}/setenv_${SYSTEM_KEY}.bash - . ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash -module list +#module list echo "" -read -p "Mostrando modulos carregados - Pressione Enter para continuar.... " +#read -p "Mostrando modulos carregados - Pressione Enter para continuar.... " echo "" #----------------------------------------------------------------------- From bbb7ec4d845e2e7f6ead448725216ded4226fc5b Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 17 Oct 2025 17:27:23 -0300 Subject: [PATCH 25/72] on #833: adjusting post processing to work in both, PBS and SLURM, systems. --- scripts/3.run_model.bash | 3 -- scripts/4.run_post.bash | 49 +++++++++++--------------- scripts/make_initatmos.bash | 3 -- scripts/make_template.bash | 13 ++++--- scripts/stools/setenv_PBS.bash | 1 + scripts/stools/setenv_PBS_ian.bash | 6 ++-- scripts/stools/setenv_SLURM_egeon.bash | 1 + 7 files changed, 32 insertions(+), 44 deletions(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 8eda274..080a596 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -163,7 +163,6 @@ cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} ${DIRRUN}/stream_list.atmosphere.diagnostics cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} @@ -196,8 +195,6 @@ ulimit -v unlimited ulimit -s unlimited cd ${DIRRUN} -#. setenv.bash -#. setenv_PBS_ian.bash . ${SCRIPTS}/setenv.bash diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 649440e..dee3443 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -145,15 +145,11 @@ how_many_nodes ${nfiles} ${maxpostpernode} # Cria os diretorios e arquivos/links para cada saida do convert_mpas: cd ${DIRRUN} -cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} - for ii in $(seq 1 ${nfiles}) do i=$(printf "%04d" ${ii}) mkdir -p ${DIRRUN}/dir.${i} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN}/dir.${i} -# cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN}/dir.${i} cp -f ${SCRIPTS}/namelists/include_fields.diag${VARTABLE} ${DIRRUN}/dir.${i}/include_fields.diag${VARTABLE} cp -f ${DIRRUN}/dir.${i}/include_fields.diag${VARTABLE} ${DIRRUN}/dir.${i}/include_fields sed -e "s,#NISOLEV#,${NLEV},g;s,#NMODELLEV#,${N_MODEL_LEV},g" \ @@ -166,7 +162,7 @@ done cd ${DIRRUN} chmod 755 ${DIRRUN}/* - +# Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: echo "scheduler system = " ${SCHEDULER_SYSTEM} echo "system key = " ${SYSTEM_KEY} echo "" @@ -177,17 +173,17 @@ fim=$((maxpostpernode <= nfiles ? maxpostpernode : nfiles)) while [ ${inicio} -le ${nfiles} ] do rm -f ${DIRRUN}/PostAtmos_node.${node}.sh - + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then - sed -e "s/#JOBNAME#/MO.Pos${node}/g; \ - s/#NNODES#/1/g; \ - /#NTASKS#/d; \ - /#NTASKSPNODE#/d; \ - s/#PARTITION#/${POST_QUEUE}/g; \ - s/#WALLTIME#/${POST_walltime}/g; \ - s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o|g; \ - s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e|g" \ + sed -e "s,#JOBNAME#,MO.Pos${node},g; + s,#NNODES#,${POST_nnodes},g; + s,#NTASKS#,${POST_ncores},g; + s,#NTASKSPNODE#,${POST_ncpn},g; + s,#PARTITION#,${POST_QUEUE},g; + s,#WALLTIME#,${POST_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ ${DIRRUN}/PostAtmos_node.${node}.sh else @@ -198,8 +194,6 @@ cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh cd ${DIRRUN} . ${SCRIPTS}/setenv.bash - -#. ${SCRIPTS}/stools/setenv_PBS_ian.bash chmod 755 ${DIRRUN}/* echo "Executing posts ${inicio} to ${fim} in node Node ${node}." @@ -241,7 +235,7 @@ do diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.00.00.x${RES}L${N_MODEL_LEV}.nc cd ${DIRRUN}/dir.\${i} - chmod 775 * + chmod 755 * cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post} >> convert_mpas.output & echo "cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post}" >> convert_mpas.output @@ -253,9 +247,9 @@ EOSH chmod a+x ${DIRRUN}/PostAtmos_node.${node}.sh - chmod 775 ${DIRRUN}/* + chmod 755 ${DIRRUN}/* cp -f ${DIRRUN}/PostAtmos_node.${node}.sh ${DATAOUT}/${YYYYMMDDHHi}/Post/logs - chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Post/* + chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Post/* case "${SCHEDULER_SYSTEM}" in SLURM) echo "Sbatch PostAtmos_node.${node}.sh" @@ -301,14 +295,14 @@ rm -f ${DIRRUN}/PostAtmos_node.${node}.sh if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then - sed -e "s/#JOBNAME#/MO.Pos${node}/g; \ - s/#NNODES#/1/g; \ - /#NTASKS#/d; \ - /#NTASKSPNODE#/d; \ - s/#PARTITION#/${POST_QUEUE}/g; \ - s/#WALLTIME#/${POST_walltime}/g; \ - s|#OUTPUTJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o|g; \ - s|#ERRORJOB#|${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e|g" \ + sed -e "s,#JOBNAME#,MO.Pos${node},g; + s,#NNODES#,${POST_nnodes},g; + s,#NTASKS#,${POST_ncores},g; + s,#NTASKSPNODE#,${POST_ncpn},g; + s,#PARTITION#,${POST_QUEUE},g; + s,#WALLTIME#,${POST_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ ${DIRRUN}/PostAtmos_node.${node}.sh else @@ -319,7 +313,6 @@ cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh cd ${DIRRUN} . ${SCRIPTS}/setenv.bash -#. ${SCRIPTS}/stools/setenv_PBS_ian.bash # Saving important files to the logs directory: cp -f ${EXECS}/CONVMPAS-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Post diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index c09153a..bb09c1c 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -103,7 +103,6 @@ cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}\:${start_date:0:13} ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} chmod 755 ${DIRRUN}/* chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* @@ -136,8 +135,6 @@ ulimit -s unlimited cd ${DIRRUN} -#. setenv.bash -#. setenv_PBS_ian.bash . ${SCRIPTS}/setenv.bash echo "" diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 8ad934c..0b2e5d1 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -116,11 +116,12 @@ fi # NLEVS get from t_iso_levels in Registry_isobaric.xml: if [ -s ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml ] then - chmod 775 ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml +#### chmod 755 ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml NLEV=$(grep "t_iso_levels" ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml | grep definition | cut -d\" -f4) else NLEV=18 fi +echo "checar na ian: nlev=$NLEV" output_interval=${t_strouthor} nfiles=$(echo "$FCST/$output_interval + 1" | bc) @@ -132,9 +133,8 @@ diag_name_templ=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_%y4%m2%d2%h2.%n2.00.x${RE rm -fr ${DIRRUN}/qctlinfo.gs cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} -chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Post/* +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Post/* cat > ${DIRRUN}/qctlinfo.gs < ${DIRRUN}/qctlinfo.ctl #grads -lbcx "run ${DIRRUN}/qctlinfo.gs" | awk '/dset/,/endvars/' > ${DIRRUN}/qctlinfo.ctl -chmod 775 ${DIRRUN}/qctlinfo.ctl +chmod 755 ${DIRRUN}/qctlinfo.ctl timectl=$(grep tdef ${DIRRUN}/qctlinfo.ctl | cut -d" " -f4) @@ -165,7 +164,7 @@ sed -i '3a\options template' ${DIRRUN}/qctlinfo.ctl sed -i "/tdef/c\tdef ${nfiles} linear ${timectl} ${t_stroutmin}mn" ${DIRRUN}/qctlinfo.ctl sed -i "/dset/c\dset ^${diag_name_templ}" ${DIRRUN}/qctlinfo.ctl -chmod 775 ${DIRRUN}/* +chmod 755 ${DIRRUN}/* #cp ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl mv ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl rm -fr ${DIRRUN} diff --git a/scripts/stools/setenv_PBS.bash b/scripts/stools/setenv_PBS.bash index 7ab67b7..111da1b 100755 --- a/scripts/stools/setenv_PBS.bash +++ b/scripts/stools/setenv_PBS.bash @@ -45,6 +45,7 @@ export MODEL_walltime="8:00:00" # Post phase: export POST_QUEUE="batch" ### export POST_ncores=1 not used yet +export POST_ncores=1 export POST_nnodes=1 export POST_ncpn=32 export POST_jobname="Post.MONAN" diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index a210014..3b34d5c 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -57,6 +57,7 @@ export MODEL_walltime="8:00:00" # Post phase: export POST_QUEUE="pesqextra" ### export POST_ncores=1 not used yet +export POST_ncores=1 export POST_nnodes=1 export POST_ncpn=32 export POST_jobname="Post.MONAN" @@ -70,12 +71,11 @@ export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/monan/dados/MONAN_v1.4.x-CR -export OPERDIR=/p/monan/CIs +export DIRDADOS=/p/monan/dados/MONAN_v1.4.x +export OPERDIR=/oper/dados/ioper/tempo #export DIRDADOS=/p/monan/dados/MONAN_v1.4.x #export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x - #export OPERDIR=/p/scratchin/${USER}/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL diff --git a/scripts/stools/setenv_SLURM_egeon.bash b/scripts/stools/setenv_SLURM_egeon.bash index 5cd26f8..6093820 100755 --- a/scripts/stools/setenv_SLURM_egeon.bash +++ b/scripts/stools/setenv_SLURM_egeon.bash @@ -53,6 +53,7 @@ export MODEL_walltime="8:00:00" # Post phase: export POST_QUEUE="batch" ### export POST_ncores=1 not used yet +export POST_ncores=1 export POST_nnodes=1 export POST_ncpn=32 export POST_jobname="Post.MONAN" From 1f53f68b91219440e1978249f94c9d5accd8ca64 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 17 Oct 2025 21:13:38 +0000 Subject: [PATCH 26/72] on #833: adjusting some paths for ian operation. --- scripts/make_degrib.bash | 32 ++++++++++++++---------------- scripts/stools/setenv_PBS_ian.bash | 4 ---- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 0ca33a8..725aa15 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -69,6 +69,10 @@ fi # busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! #CR: BNDDIR should be setted just for EGEON machine #CR: some local variables were mobed into the SLURM section, particularly for egeon + +echo "system_key=$SYSTEM_KEY" +echo "operdir=$OPERDIR" + case "${SYSTEM_KEY}" in SLURM_egeon) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, @@ -82,7 +86,7 @@ case "${SYSTEM_KEY}" in # to find the gfs file: echo "Rodando em PBS" OPERDIREXP=${OPERDIR}/${EXP} - # BNDDIR= + BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -117,8 +121,11 @@ esac #fi #Fazendo download da condicao de contorno -echo "server" -echo $HOSTNAME + +echo "hostname=$HOSTNAME" +echo "operdirexp=$OPERDIREXP" +echo "bnddir=$BNDDIR" +echo "gcccis=$GCCCIS" if [ "$HOSTNAME" = "egeon" ]; then if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then @@ -141,6 +148,7 @@ else fi fi fi + if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then echo -e "${RED}==>${NC}Condicao de contorno inexistente !" echo -e "${RED}==>${NC}Check ${BNDDIR} or." @@ -170,20 +178,14 @@ done cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} - -cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} - +#cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} - -cp -f ${SCRIPTS}/stools/setenv_${SCHEDULER_SYSTEM}_${HOSTNAME}.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash -ls -ltr ${DIRRUN} -echo "" if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then @@ -211,8 +213,6 @@ export PMIX_MCA_gds=hash export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 cd ${DIRRUN} -#. setenv.bash -#. setenv_PBS_ian.bash . ${SCRIPTS}/setenv.bash @@ -223,7 +223,7 @@ rm -f GRIBFILE.* namelist.wps sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps -#read -p "executando o link_grib" + echo "" ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 @@ -235,8 +235,6 @@ echo "submetendo jobs ungrib" time mpirun -np 1 ./ungrib.exe -#time mpiexec -np 1 ./ungrib.exe -#time /opt/pbs/bin/mpiexec -np 1 ./ungrib.exe date @@ -299,5 +297,5 @@ do done mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* rm -fr ${DIRRUN} diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 3b34d5c..9e3fd85 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -3,7 +3,6 @@ # Load modules: module purge module load PrgEnv-intel -module load intel/2025.0 module load craype-x86-turin module load cray-hdf5/1.14.3.3 module load cray-netcdf/4.9.0.15 @@ -74,9 +73,6 @@ export PNETCDFDIR=${PNETCDF} export DIRDADOS=/p/monan/dados/MONAN_v1.4.x export OPERDIR=/oper/dados/ioper/tempo -#export DIRDADOS=/p/monan/dados/MONAN_v1.4.x -#export DIRDADOS=/p/scratchin/${USER}/monan/MONAN_v1.4.x -#export OPERDIR=/p/scratchin/${USER}/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= From f7072de09b62d1a7fe7bfb2c362a88a5f3103abd Mon Sep 17 00:00:00 2001 From: egkhamis Date: Sat, 18 Oct 2025 09:02:28 +0000 Subject: [PATCH 27/72] =?UTF-8?q?=E2=80=9Con?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/2.pre_processing.bash | 52 ++++++----------------------------- 1 file changed, 8 insertions(+), 44 deletions(-) diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 86477b0..4f08cb7 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -82,48 +82,17 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" -#git log -1 --name-only git log | head -1 -echo "" -echo ${SYSTEM_KEY} -echo "" -#echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" -#mkdir -p ${DATAIN} -#rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -#rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -#ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - -#read -p "Verificar a copia de datain/fixed // datain/execs // e link do WPS" - -case "${SYSTEM_KEY}" in - SLURM_egeon) - echo -e "${GREEN}==>${NC} copying and linking fixed input data for Egeon... \n" - mkdir -p ${DATAIN} - rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} - rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} - ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - ;; - PBS_ian) - echo -e "${GREEN}==>${NC} copying and linking fixed input data for IAN... \n" - mkdir -p ${DATAIN}/fixed - rsync -av --exclude='x1*' ${DIRDADOS}/MONAN_datain/datain/fixed/ ${DATAIN}/fixed/ - chmod 775 ${DATAIN}/fixed/* - #cp -f ${DIRDADOS}/MONAN_datain/execs/ungrib.exe ${EXECS} - cp -f /p/monan/dados/MONAN_v1.4.x-CR/MONAN_datain/execs/ungrib.exe ${EXECS} - - chmod 775 ${EXECS}/* - ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - ;; - -esac - - -#rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc -#rm -fr ${DATAOUT}/logs/* -# Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- +echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" +mkdir -p ${DATAIN} +rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} +rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} +ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} + +# 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" @@ -134,15 +103,10 @@ fi #---------------------------------------------------------------------------------- -#if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} ] -#then + # Degrib phase:--------------------------------------------------------------------- echo -e "${GREEN}==>${NC} Running Degrib:\n" time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#else -#echo -e "${GREEN}==>${NC} File ${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2} already exist in ${DATAOUT}/${YYYYMMDDHHi}/Pre.\n" -#fi - #---------------------------------------------------------------------------------- From 9e1cc715aa6fa9eb040f433b9231e1b22c12da4a Mon Sep 17 00:00:00 2001 From: egkhamis Date: Mon, 20 Oct 2025 13:11:15 +0000 Subject: [PATCH 28/72] on #844: adjusting the PBS scripts to deal with openmp and the 10km resolution. --- scripts/3.run_model.bash | 16 ++++++--- scripts/4.run_post.bash | 8 +++-- scripts/make_degrib.bash | 4 ++- scripts/make_initatmos.bash | 4 ++- scripts/make_static.bash | 2 ++ scripts/stools/setenv_PBS_ian.bash | 39 ++++++++++++++++++--- scripts/stools/submit_PBS_ian.bash_TEMPLATE | 10 +++--- 7 files changed, 62 insertions(+), 21 deletions(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 080a596..a945730 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -165,7 +165,6 @@ cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} - chmod 755 ${DIRRUN} rm -f ${DIRRUN}/model.bash @@ -174,8 +173,10 @@ if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,${MODEL_jobname},g; s,#NNODES#,${MODEL_nnodes},g; + s,#NCPUS#,${MODEL_ncpus},g; s,#NTASKS#,${MODEL_ncores},g; s,#NTASKSPNODE#,${MODEL_ncpn},g; + s,#NTHREADS#,${MODEL_nthreads},g; s,#PARTITION#,${MODEL_QUEUE},g; s,#WALLTIME#,${MODEL_walltime},g; s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o,g; @@ -187,7 +188,6 @@ fi cat << EOF0 >> ${DIRRUN}/model.bash - export executable=atmosphere_model ulimit -c unlimited @@ -197,9 +197,14 @@ ulimit -s unlimited cd ${DIRRUN} . ${SCRIPTS}/setenv.bash - date -time mpirun -np ${MODEL_ncores} ./\${executable} +beg_secs=\`date +"%s"\` + +time mpirun --ppn ${MODEL_ncpn} -np ${MODEL_ncores} --depth=${MODEL_nthreads} --cpu-bind depth ./\${executable} + +end_secs=\`date +"%s"\` +let wallsecs=\$end_secs-\$beg_secs +echo "MONAN time taken by run in seconds is " \$wallsecs date # @@ -219,6 +224,7 @@ EOF0 chmod a+x ${DIRRUN}/model.bash + case "${SCHEDULER_SYSTEM}" in SLURM) echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" @@ -229,7 +235,7 @@ case "${SCHEDULER_SYSTEM}" in ;; PBS) echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" + echo -e "${GREEN}==>${NC} qsub model.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/model.bash ;; diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index dee3443..a723e7a 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -178,14 +178,16 @@ do then sed -e "s,#JOBNAME#,MO.Pos${node},g; s,#NNODES#,${POST_nnodes},g; + s,#NCPUS#,${POST_ncpus},g; s,#NTASKS#,${POST_ncores},g; s,#NTASKSPNODE#,${POST_ncpn},g; + s,#NTHREADS#,${POST_nthreads},g; s,#PARTITION#,${POST_QUEUE},g; s,#WALLTIME#,${POST_walltime},g; s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ - ${DIRRUN}/PostAtmos_node.${node}.sh + ${DIRRUN}/PostAtmosY_node.${node}.sh else echo "#!/bin/bash " > ${DIRRUN}/PostAtmos_node.${node}.sh fi @@ -259,7 +261,7 @@ EOSH ;; PBS) echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" + echo -e "${GREEN}==>${NC} qsub PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} echo "executando qsub pegando jobid" jobid[${node}]=$(qsub -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) @@ -342,7 +344,7 @@ case "${SCHEDULER_SYSTEM}" in ;; PBS) echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch PostAtmos_node.${node}.sh...\n" + echo -e "${GREEN}==>${NC} qsub PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} echo "submetendo de novo" jobid[${node}]=$(qsub -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 725aa15..8e4e6d7 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -191,8 +191,10 @@ if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; s,#NNODES#,${DEGRIB_nnodes},g; + s,#NCPUS#,${DEGRIB_ncpus},g; s,#NTASKS#,${DEGRIB_ncores},g; s,#NTASKSPNODE#,${DEGRIB_ncpn},g; + s,#NTHREADS#,${DEGRIB_nthreads},g; s,#PARTITION#,${DEGRIB_QUEUE},g; s,#WALLTIME#,${DEGRIB_walltime},g; s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; @@ -272,7 +274,7 @@ case "${SCHEDULER_SYSTEM}" in ;; PBS) echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch degrib.bash...\n" + echo -e "${GREEN}==>${NC} qsub degrib.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/degrib.bash ;; diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index bb09c1c..f979633 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -114,8 +114,10 @@ if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,${INITATMOS_jobname},g; s,#NNODES#,${INITATMOS_nnodes},g; + s,#NCPUS#,${INITATMOS_ncpus},g; s,#NTASKS#,${INITATMOS_ncores},g; s,#NTASKSPNODE#,${INITATMOS_ncpn},g; + s,#NTHREADS#,${INITATMOS_nthreads},g; s,#PARTITION#,${INITATMOS_QUEUE},g; s,#WALLTIME#,${INITATMOS_walltime},g; s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o,g; @@ -160,7 +162,7 @@ case "${SCHEDULER_SYSTEM}" in ;; PBS) echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" + echo -e "${GREEN}==>${NC} qsub initatmos.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/initatmos.bash ;; diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 79247c8..05b2a43 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -115,8 +115,10 @@ if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,${STATIC_jobname},g; s,#NNODES#,${STATIC_nnodes},g; + s,#NCPUS#,${STATIC_ncpus},g; s,#NTASKS#,${STATIC_ncores},g; s,#NTASKSPNODE#,${STATIC_ncpn},g; + s,#NTHREADS#,${STATIC_nthreads},g; s,#PARTITION#,${STATIC_QUEUE},g; s,#WALLTIME#,${STATIC_walltime},g; s,#OUTPUTJOB#,${DATAOUT}/logs/static.bash.o,g; diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 9e3fd85..6b0d7ff 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -20,7 +20,9 @@ module list export STATIC_QUEUE="pesqextra" export STATIC_ncores=32 export STATIC_nnodes=1 +export STATIC_ncpus=32 export STATIC_ncpn=32 +export STATIC_nthreads=1 export STATIC_jobname="Pre.static" export STATIC_walltime="02:00:00" @@ -29,7 +31,9 @@ export STATIC_walltime="02:00:00" export DEGRIB_QUEUE="pesqextra" export DEGRIB_ncores=1 export DEGRIB_nnodes=1 +export DEGRIB_ncpus=1 export DEGRIB_ncpn=1 +export DEGRIB_nthreads=1 export DEGRIB_jobname="Pre.degrib" export DEGRIB_walltime="02:00:00" @@ -38,16 +42,40 @@ export DEGRIB_walltime="02:00:00" export INITATMOS_QUEUE="pesqextra" export INITATMOS_ncores=64 export INITATMOS_nnodes=1 +export INITATMOS_ncpus=64 export INITATMOS_ncpn=64 +export INITATMOS_nthreads=1 export INITATMOS_jobname="Pre.InitAtmos" export INITATMOS_walltime="02:00:00" # Model phase: export MODEL_QUEUE="pesqextra" -export MODEL_ncores=512 -export MODEL_nnodes=8 -export MODEL_ncpn=64 +#export MODEL_ncores=8192 +#export MODEL_nnodes=32 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 +#export MODEL_ncores=7680 +#export MODEL_nnodes=30 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 +#export MODEL_ncores=1024 +#export MODEL_nnodes=16 +#export MODEL_ncpus=256 +#export MODEL_ncpn=64 +#export MODEL_nthreads=4 +#export MODEL_ncores=4096 +#export MODEL_nnodes=20 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 +export MODEL_ncores=6144 +export MODEL_nnodes=24 +export MODEL_ncpus=256 +export MODEL_ncpn=256 +export MODEL_nthreads=1 export MODEL_jobname="Model.MONAN" export MODEL_walltime="8:00:00" #PBS -l select=8:ncpus=64:mpiprocs=64 == 512mpi, 8nodes, 64cpn @@ -55,10 +83,11 @@ export MODEL_walltime="8:00:00" # Post phase: export POST_QUEUE="pesqextra" -### export POST_ncores=1 not used yet -export POST_ncores=1 +export POST_ncores=32 export POST_nnodes=1 +export POST_ncpus=32 export POST_ncpn=32 +export POST_nthreads=1 export POST_jobname="Post.MONAN" export POST_walltime="8:00:00" diff --git a/scripts/stools/submit_PBS_ian.bash_TEMPLATE b/scripts/stools/submit_PBS_ian.bash_TEMPLATE index 1c392bd..6769b75 100755 --- a/scripts/stools/submit_PBS_ian.bash_TEMPLATE +++ b/scripts/stools/submit_PBS_ian.bash_TEMPLATE @@ -1,15 +1,13 @@ -#!/bin/bash -x +#!/bin/bash -####PBS -l select=:ncpus=:mpiprocs= +####PBS -l select=:ncpus=:mpiprocs=:ompthreads= #PBS -N #JOBNAME# #PBS -q #PARTITION# -#PBS -l select=#NNODES#:ncpus=#NTASKSPNODE#:mpiprocs=#NTASKSPNODE# +#PBS -l select=#NNODES#:ncpus=#NCPUS#:mpiprocs=#NTASKSPNODE#:ompthreads=#NTHREADS# #PBS -l walltime=#WALLTIME# #PBS -o #OUTPUTJOB# #PBS -e #ERRORJOB# -#PBS -l place=excl +#PBS -l place=scatter:excl #PBS -V - - From bc7543fd149ae5ad2aafd6f6ea7107485ca8086a Mon Sep 17 00:00:00 2001 From: egkhamis Date: Mon, 20 Oct 2025 23:02:26 +0000 Subject: [PATCH 29/72] on #844: adjusting the PBS scripts to deal with openmp and the 10km resolution. Better performance. --- scripts/3.run_model.bash | 14 ++++--- scripts/4.run_post.bash | 4 +- scripts/make_degrib.bash | 49 +++++++++++----------- scripts/make_initatmos.bash | 16 +++++-- scripts/make_static.bash | 24 ++++++----- scripts/make_template.bash | 2 - scripts/setenv.bash | 21 ++++------ scripts/stools/setenv_PBS_ian.bash | 67 +++++++++++++++++------------- 8 files changed, 109 insertions(+), 88 deletions(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index a945730..6823f9b 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -200,31 +200,33 @@ cd ${DIRRUN} date beg_secs=\`date +"%s"\` -time mpirun --ppn ${MODEL_ncpn} -np ${MODEL_ncores} --depth=${MODEL_nthreads} --cpu-bind depth ./\${executable} +if [ "$HOSTNAME" = "egeon" ]; then + time mpirun -np ${MODEL_ncores} ./\${executable} +else + time mpirun --ppn ${MODEL_ncpn} -np ${MODEL_ncores} --depth=${MODEL_nthreads} --cpu-bind depth ./\${executable} +fi +date end_secs=\`date +"%s"\` + let wallsecs=\$end_secs-\$beg_secs echo "MONAN time taken by run in seconds is " \$wallsecs -date # # move dataout, clean up and remove files/links # mv MONAN_DIAG_* ${DATAOUT}/${YYYYMMDDHHi}/Model -mv MONAN_HIST_* ${DATAOUT}/${YYYYMMDDHHi}/Model cp -f ${EXECS}/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model cp -f ${EXECS}/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/ cp -f ${DIRHOMES}/VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/SCRIPTSCDCT-VERSION.txt cp -f ${MONANDIR}/README.md ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/ -mv log.atmosphere.*.out ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv log.atmosphere.*.err ${DATAOUT}/${YYYYMMDDHHi}/Model/logs +mv log.atmosphere.* ${DATAOUT}/${YYYYMMDDHHi}/Model/logs mv namelist.atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Model/logs mv stream* ${DATAOUT}/${YYYYMMDDHHi}/Model/logs EOF0 chmod a+x ${DIRRUN}/model.bash - case "${SCHEDULER_SYSTEM}" in SLURM) echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index a723e7a..d479d45 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -187,7 +187,7 @@ do s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > \ - ${DIRRUN}/PostAtmosY_node.${node}.sh + ${DIRRUN}/PostAtmos_node.${node}.sh else echo "#!/bin/bash " > ${DIRRUN}/PostAtmos_node.${node}.sh fi @@ -299,8 +299,10 @@ if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,MO.Pos${node},g; s,#NNODES#,${POST_nnodes},g; + s,#NCPUS#,${POST_ncpus},g; s,#NTASKS#,${POST_ncores},g; s,#NTASKSPNODE#,${POST_ncpn},g; + s,#NTHREADS#,${POST_nthreads},g; s,#PARTITION#,${POST_QUEUE},g; s,#WALLTIME#,${POST_walltime},g; s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Post/logs/PostAtmos_node.${node}.o,g; diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 8e4e6d7..cd0fa38 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -79,7 +79,7 @@ case "${SYSTEM_KEY}" in # to find the gfs file: OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - GCCCIS=/mnt/beegfs/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} + GCCCIS=/mnt/beegfs/monan/CIs/${EXP} ;; PBS_ian) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, @@ -87,6 +87,7 @@ case "${SYSTEM_KEY}" in echo "Rodando em PBS" OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} + #GCCCIS=/p/monan/CIs/${EXP} GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -106,27 +107,9 @@ esac -#CR: maybe this if should belong to the SLURM kind of running... -#if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -#then -# if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -# then -# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" -# echo -e "${RED}==>${NC}Check ${BNDDIR} or." -# echo -e "${RED}==>${NC}Check ${GCCCIS}" -# exit 1 -# else -# BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} -# fi -#fi #Fazendo download da condicao de contorno -echo "hostname=$HOSTNAME" -echo "operdirexp=$OPERDIREXP" -echo "bnddir=$BNDDIR" -echo "gcccis=$GCCCIS" - if [ "$HOSTNAME" = "egeon" ]; then if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then echo "rsync OK!" @@ -148,7 +131,6 @@ else fi fi fi - if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then echo -e "${RED}==>${NC}Condicao de contorno inexistente !" echo -e "${RED}==>${NC}Check ${BNDDIR} or." @@ -157,14 +139,31 @@ if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib fi -files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") +## Se nao existir CI no diretorio do IO, +## busca no nosso dir /beegfs/monan/CIs (Egeon) , /p/monan/CIs (xd2000) se nao existir tbm, aborta! +#CR: maybe this if should belong to the SLURM kind of running... +#if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +#then +# if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +# then +# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" +# echo -e "${RED}==>${NC}Check ${BNDDIR} or." +# echo -e "${RED}==>${NC}Check ${GCCCIS}" +# exit 1 +# else +# BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} +# fi +#fi +echo "hostname=$HOSTNAME" +echo "operdirexp=$OPERDIREXP" +echo "bnddir=$BNDDIR" +echo "gcccis=$GCCCIS" +files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") #files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") - - for file in "${files_needed[@]}" do if [ ! -s "${file}" ] @@ -179,9 +178,11 @@ cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} #cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE #cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} -cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE + + cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index f979633..6ac9e0f 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -139,11 +139,21 @@ ulimit -s unlimited cd ${DIRRUN} . ${SCRIPTS}/setenv.bash -echo "" + date -#time mpiexec -np ${INITATMOS_ncores} ./\${executable} -time mpirun -np ${INITATMOS_ncores} ./\${executable} +beg_secs=\`date +"%s"\` + +if [ "$HOSTNAME" = "egeon" ]; then + time mpirun -np ${INITATMOS_ncores} ./\${executable} +else + time mpirun --ppn ${INITATMOS_ncpn} -np ${INITATMOS_ncores} --depth=${INITATMOS_nthreads} --cpu-bind depth ./\${executable} +fi + date +end_secs=\`date +"%s"\` + +let wallsecs=\$end_secs-\$beg_secs +echo "INITATMOS time taken by run in seconds is " \$wallsecs mv ${DIRRUN}/log.init_atmosphere.0000.out ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/log.init_atmosphere.0000.x1.${RES}.init.nc.${YYYYMMDDHHi}.out diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 05b2a43..bb1da2f 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -142,14 +142,23 @@ ulimit -v unlimited . ${SCRIPTS}/setenv.bash cd ${DIRRUN} - - chmod 755 * + date +beg_secs=\`date +"%s"\` -time mpirun -np ${STATIC_ncores} ./\${executable} +if [ "$HOSTNAME" = "egeon" ]; then + time mpirun -np ${STATIC_ncores} ./\${executable} +else + time mpirun --ppn ${STATIC_ncpn} -np ${STATIC_ncores} --depth=${STATIC_nthreads} --cpu-bind depth ./\${executable} +fi date +end_secs=\`date +"%s"\` + +let wallsecs=\$end_secs-\$beg_secs +echo "STATIC time taken by run in seconds is " \$wallsecs + grep "Finished running" log.init_atmosphere.0000.out >& /dev/null if [ \$? -ne 0 ]; then @@ -166,9 +175,6 @@ echo " ####################################" echo " " -mv log.init_atmosphere.0000.out ${DATAOUT}/logs/log.init_atmosphere.0000.x1.${RES}.static.nc.out - - EOF0 chmod a+x ${DIRRUN}/static.bash rm -fr ${DATAIN}/fixed/x1.${RES}.static.nc @@ -182,7 +188,7 @@ case "${SCHEDULER_SYSTEM}" in ;; PBS) echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch static.bash...\n" + echo -e "${GREEN}==>${NC} qsub static.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/static.bash ;; @@ -193,12 +199,10 @@ case "${SCHEDULER_SYSTEM}" in # ;; esac -#read -p "movendo arquivos" mv ${DIRRUN}/static.bash ${DATAOUT}/logs/ mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ -#mv log.init_atmosphere.0000.out ${DATAOUT}/logs/ -mv log.init_atmosphere*err ${DATAOUT}/logs/ +mv log.init_atmosphere.* ${DATAOUT}/logs/ if [ -s ${DIRRUN}/x1.${RES}.static.nc ] diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 0b2e5d1..81596d0 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -116,12 +116,10 @@ fi # NLEVS get from t_iso_levels in Registry_isobaric.xml: if [ -s ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml ] then -#### chmod 755 ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml NLEV=$(grep "t_iso_levels" ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml | grep definition | cut -d\" -f4) else NLEV=18 fi -echo "checar na ian: nlev=$NLEV" output_interval=${t_strouthor} nfiles=$(echo "$FCST/$output_interval + 1" | bc) diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 8d4d39c..78fb92d 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -43,26 +43,23 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # Set environment variables and importants directories-------------------------------------------------- + # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=$(pwd) +export DIR_SCRIPTS=$(pwd) export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=$(pwd) - - -echo "dir dados = "${DIR_DADOS} -echo "" -echo "dir scripts = "${DIR_SCRIPTS} +export MONANDIR=$(pwd) # Load your system setenv: - . ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash + #module list -echo "" +#echo "" #read -p "Mostrando modulos carregados - Pressione Enter para continuar.... " -echo "" +#echo "" + #----------------------------------------------------------------------- # We discourage changing the variables below: @@ -103,7 +100,3 @@ how_many_nodes () { #---------------------------------------------------------------------------------------------- - - - - diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 6b0d7ff..0eef304 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -18,10 +18,10 @@ module list # PRE-Static phase: export STATIC_QUEUE="pesqextra" -export STATIC_ncores=32 +export STATIC_ncores=128 export STATIC_nnodes=1 -export STATIC_ncpus=32 -export STATIC_ncpn=32 +export STATIC_ncpus=128 +export STATIC_ncpn=128 export STATIC_nthreads=1 export STATIC_jobname="Pre.static" export STATIC_walltime="02:00:00" @@ -40,10 +40,10 @@ export DEGRIB_walltime="02:00:00" # PRE-Init Atmosphere phase: export INITATMOS_QUEUE="pesqextra" -export INITATMOS_ncores=64 +export INITATMOS_ncores=128 export INITATMOS_nnodes=1 -export INITATMOS_ncpus=64 -export INITATMOS_ncpn=64 +export INITATMOS_ncpus=128 +export INITATMOS_ncpn=128 export INITATMOS_nthreads=1 export INITATMOS_jobname="Pre.InitAtmos" export INITATMOS_walltime="02:00:00" @@ -51,28 +51,8 @@ export INITATMOS_walltime="02:00:00" # Model phase: export MODEL_QUEUE="pesqextra" -#export MODEL_ncores=8192 -#export MODEL_nnodes=32 -#export MODEL_ncpus=256 -#export MODEL_ncpn=256 -#export MODEL_nthreads=1 -#export MODEL_ncores=7680 -#export MODEL_nnodes=30 -#export MODEL_ncpus=256 -#export MODEL_ncpn=256 -#export MODEL_nthreads=1 -#export MODEL_ncores=1024 -#export MODEL_nnodes=16 -#export MODEL_ncpus=256 -#export MODEL_ncpn=64 -#export MODEL_nthreads=4 -#export MODEL_ncores=4096 -#export MODEL_nnodes=20 -#export MODEL_ncpus=256 -#export MODEL_ncpn=256 -#export MODEL_nthreads=1 -export MODEL_ncores=6144 -export MODEL_nnodes=24 +export MODEL_ncores=8192 +export MODEL_nnodes=32 export MODEL_ncpus=256 export MODEL_ncpn=256 export MODEL_nthreads=1 @@ -108,5 +88,36 @@ export PIO= export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib:$LD_LIBRARY_PATH +# +# -------- Tested Configurations --------- +# + +#export MODEL_ncores=8192 +#export MODEL_nnodes=32 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=7680 +#export MODEL_nnodes=30 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=1024 +#export MODEL_nnodes=16 +#export MODEL_ncpus=256 +#export MODEL_ncpn=64 +#export MODEL_nthreads=4 +#export MODEL_ncores=4096 +#export MODEL_nnodes=20 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 +#export MODEL_ncores=6144 +#export MODEL_nnodes=24 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 From 96e84718af9ecbf4a0d92884728aad2d8180139f Mon Sep 17 00:00:00 2001 From: egkhamis Date: Tue, 21 Oct 2025 00:12:49 +0000 Subject: [PATCH 30/72] on #844: make_degrib now uses gfs data from /oper/dados/ioper/tempo/GFS in PBS system. --- scripts/make_degrib.bash | 113 ++++++++++++++++++++------------------- 1 file changed, 57 insertions(+), 56 deletions(-) diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index cd0fa38..64afe5c 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -75,8 +75,8 @@ echo "operdir=$OPERDIR" case "${SYSTEM_KEY}" in SLURM_egeon) - #CR: Here is the place to setup the CI directory into ${BNDDIR} var, - # to find the gfs file: + #CR: Here is the place to setup the CI directory into ${BNDDIR} var, + # to find the gfs file: OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} GCCCIS=/mnt/beegfs/monan/CIs/${EXP} @@ -87,15 +87,15 @@ case "${SYSTEM_KEY}" in echo "Rodando em PBS" OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - #GCCCIS=/p/monan/CIs/${EXP} - GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} - if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then - echo "rsync OK!" - else - echo "rsync error!" - echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" - exit 1 - fi + GCCCIS=/p/monan/CIs/${EXP} + #GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} + #if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then + # echo "rsync OK!" + #else + # echo "rsync error!" + # echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" + # exit 1 + #fi ;; GENERIC) #CR: Here is the place to setup the CI directory into ${BNDDIR} var, @@ -110,59 +110,59 @@ esac #Fazendo download da condicao de contorno -if [ "$HOSTNAME" = "egeon" ]; then - if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then - echo "rsync OK!" - else - echo "rsync error!" - echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" - exit 1 - fi -else - if [ ! -e "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then - - if wget "http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" \ - -O "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2"; then - echo "wget OK!" - else - echo "wget error!" - echo "Link: http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" - exit 1 - fi - fi -fi -if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then - echo -e "${RED}==>${NC}Condicao de contorno inexistente !" - echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}" - exit 1 -fi +#if [ "$HOSTNAME" = "egeon" ]; then +# if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then +# echo "rsync OK!" +# else +# echo "rsync error!" +# echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" +# exit 1 +# fi +#else +# if [ ! -e "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then +# +# if wget "http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" \ +# -O "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2"; then +# echo "wget OK!" +# else +# echo "wget error!" +# echo "Link: http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" +# exit 1 +# fi +# fi +#fi +#if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then +# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" +# echo -e "${RED}==>${NC}Check ${BNDDIR} or." +# echo -e "${RED}==>${NC}Check ${GCCCIS}" +# exit 1 +#fi -## Se nao existir CI no diretorio do IO, -## busca no nosso dir /beegfs/monan/CIs (Egeon) , /p/monan/CIs (xd2000) se nao existir tbm, aborta! +# Se nao existir CI no diretorio do IO, +# busca no nosso dir /beegfs/monan/CIs (Egeon) , /p/monan/CIs (xd2000) se nao existir tbm, aborta! #CR: maybe this if should belong to the SLURM kind of running... -#if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -#then -# if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -# then -# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" -# echo -e "${RED}==>${NC}Check ${BNDDIR} or." -# echo -e "${RED}==>${NC}Check ${GCCCIS}" -# exit 1 -# else -# BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} -# fi -#fi +if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] +then + if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] + then + echo -e "${RED}==>${NC}Condicao de contorno inexistente !" + echo -e "${RED}==>${NC}Check ${BNDDIR} or." + echo -e "${RED}==>${NC}Check ${GCCCIS}" + exit 1 + else + BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} + fi +fi echo "hostname=$HOSTNAME" echo "operdirexp=$OPERDIREXP" echo "bnddir=$BNDDIR" echo "gcccis=$GCCCIS" -files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") +#files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") -#files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") +files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") for file in "${files_needed[@]}" do @@ -177,10 +177,11 @@ done cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} -#cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE + +cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} #cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} +#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} From 6d2748f636c66940219c11872e27d762fbfa82e0 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 21 Oct 2025 18:10:39 +0000 Subject: [PATCH 31/72] #833: In 4th step: - qsub command was established to correctly use dependencies on previous jobs. qsub -W depend= -W block=true /PostAtmos_node..sh Now, the post_0 only run after all posts get finished. some unnecessary echoes were removed; make template its ok, but the grads from system does not have sdfope support. --- scripts/0.run_all.bash | 17 ++++++++++------- scripts/4.run_post.bash | 18 +++++++----------- scripts/make_template.bash | 6 +----- scripts/setenv.bash | 4 ++-- scripts/stools/setenv_PBS_ian.bash | 2 +- 5 files changed, 21 insertions(+), 26 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 08e2041..e834f94 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -44,26 +44,29 @@ monan_branch=feature/monan-833-NF convertmpas_branch=1.2.0 EXP=GFS RES=1024002 -YYYYMMDDHHi=2025061600 +YYYYMMDDHHi=2025101900 #FCST=24 -FCST=6 +FCST=12 #---------------------------------------------------------------------- # STEP 1: Installing and compiling the A-MONAN model and utility programs: -time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +#exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#exit # STEP 3: Executing the Model run: -time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#exit # STEP 4: Executing the Post of Model run: time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #volta o dirname -sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=\$(pwd)\ ;" setenv.bash -sed -i "s;MONANDIR=.*$;MONANDIR=\$(pwd)\ ;" setenv.bash +#sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=\$(pwd)\ ;" setenv.bash +#sed -i "s;MONANDIR=.*$;MONANDIR=\$(pwd)\ ;" setenv.bash exit diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index d479d45..773a583 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -160,7 +160,7 @@ do done cd ${DIRRUN} -chmod 755 ${DIRRUN}/* +chmod -R 755 ${DIRRUN}/* # Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: echo "scheduler system = " ${SCHEDULER_SYSTEM} @@ -263,8 +263,7 @@ EOSH echo "Rodando em PBS" echo -e "${GREEN}==>${NC} qsub PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} - echo "executando qsub pegando jobid" - jobid[${node}]=$(qsub -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) + jobid[${node}]=$(qsub ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) ;; # GENERIC) # echo "Nenhum gerenciador detectado" @@ -282,7 +281,6 @@ done - # Dependencias JobId: dependency="afterok" for job_id in "${jobid[@]}" @@ -330,15 +328,14 @@ cp -f ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/* ${DATAOUT}/${YYYYMMDDHHi}/Post/logs cp -f ${DATAOUT}/${YYYYMMDDHHi}/Model/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Post/logs -####cd ${DIRRUN}/.. -####rm -fr ${DIRRUN} +cd ${DIRRUN}/.. +rm -fr ${DIRRUN} EOSH chmod a+x ${DIRRUN}/PostAtmos_node.${node}.sh - case "${SCHEDULER_SYSTEM}" in SLURM) echo "Sbatch PostAtmos_node.${node}.sh" @@ -348,16 +345,15 @@ case "${SCHEDULER_SYSTEM}" in echo "Rodando em PBS" echo -e "${GREEN}==>${NC} qsub PostAtmos_node.${node}.sh...\n" cd ${DIRRUN} - echo "submetendo de novo" - jobid[${node}]=$(qsub -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh | cut -d '.' -f1) - - ;; + qsub -W depend=${dependency} -W block=true ${DIRRUN}/PostAtmos_node.${node}.sh + ;; # GENERIC) # echo "Nenhum gerenciador detectado" # ${DIRRUN}/PostAtmos_node.${node}.sh # ;; esac + #CR: passar este scriptpara dentro do script PostAtmos_node.0.sh, submetido. cd ${SCRIPTS} chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Post/* diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 81596d0..969ba76 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -151,9 +151,6 @@ chmod 755 * grads -blc "run ${DIRRUN}/qctlinfo.gs" | awk '/dset/,/endvars/' > ${DIRRUN}/qctlinfo.ctl - -#grads -lbcx "run ${DIRRUN}/qctlinfo.gs" | awk '/dset/,/endvars/' > ${DIRRUN}/qctlinfo.ctl - chmod 755 ${DIRRUN}/qctlinfo.ctl @@ -161,8 +158,7 @@ timectl=$(grep tdef ${DIRRUN}/qctlinfo.ctl | cut -d" " -f4) sed -i '3a\options template' ${DIRRUN}/qctlinfo.ctl sed -i "/tdef/c\tdef ${nfiles} linear ${timectl} ${t_stroutmin}mn" ${DIRRUN}/qctlinfo.ctl sed -i "/dset/c\dset ^${diag_name_templ}" ${DIRRUN}/qctlinfo.ctl - +exit chmod 755 ${DIRRUN}/* -#cp ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl mv ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl rm -fr ${DIRRUN} diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 78fb92d..ee3b26a 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -46,9 +46,9 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=$(pwd) +export DIR_SCRIPTS=/lustre/projetos/monan_adm/carlos.souza/scripts_CD-CT/scripts export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=$(pwd) +export MONANDIR=/lustre/projetos/monan_adm/carlos.souza/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF # Load your system setenv: diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index 0eef304..f3b57d6 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -7,7 +7,7 @@ module load craype-x86-turin module load cray-hdf5/1.14.3.3 module load cray-netcdf/4.9.0.15 module load cray-parallel-netcdf/1.12.3.15 -#module load grads/2.2.1 +module load grads/2.2.1 module load cdo/2.4.2 module load METIS/5.1.0 module load cray-pals From 7fa27c47ad6432b59db3fac44374c595bb391132 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Wed, 22 Oct 2025 10:47:21 +0000 Subject: [PATCH 32/72] on #844: adding configuration for running the model with 3 Km of resolution. The number of nodes and processors was replaced in the pre-processing to handle this configuration. --- scripts/3.run_model.bash | 3 +++ scripts/4.run_post.bash | 7 +++++++ scripts/stools/setenv_PBS_ian.bash | 10 +++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 6823f9b..e1e3dec 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -100,6 +100,9 @@ elif [ $RES -eq 5898242 ]; then #10Km CONFIG_DT=60.0 CONFIG_LEN_DISP=10000.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [ $RES -eq 65536002 ]; then #3Km + CONFIG_DT=18.0 + CONFIG_CONV_INTERVAL="00:15:00" fi #------------------------------------------------------- diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 773a583..f03e1a7 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -115,6 +115,13 @@ elif [ $RES -eq 5898242 ]; then #10Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [ $RES -eq 65536002 ]; then #3Km + NLAT=6001 #180/0.03 + NLON=12001 #360/0.03 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 fi #------------------------------------------------------- diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian.bash index f3b57d6..b323d75 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian.bash @@ -19,9 +19,9 @@ module list # PRE-Static phase: export STATIC_QUEUE="pesqextra" export STATIC_ncores=128 -export STATIC_nnodes=1 -export STATIC_ncpus=128 -export STATIC_ncpn=128 +export STATIC_nnodes=4 +export STATIC_ncpus=32 +export STATIC_ncpn=32 export STATIC_nthreads=1 export STATIC_jobname="Pre.static" export STATIC_walltime="02:00:00" @@ -40,8 +40,8 @@ export DEGRIB_walltime="02:00:00" # PRE-Init Atmosphere phase: export INITATMOS_QUEUE="pesqextra" -export INITATMOS_ncores=128 -export INITATMOS_nnodes=1 +export INITATMOS_ncores=512 +export INITATMOS_nnodes=4 export INITATMOS_ncpus=128 export INITATMOS_ncpn=128 export INITATMOS_nthreads=1 From 66c842bd2bee4c6eec6cdc000c1eb1104caa565d Mon Sep 17 00:00:00 2001 From: egkhamis Date: Wed, 22 Oct 2025 11:08:27 -0300 Subject: [PATCH 33/72] on #833: source the environment again (. setenv.bash) to avoid initial compilation failure at different systems. --- scripts/1.install_monan.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 91d7595..87262b9 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -106,6 +106,7 @@ $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) chmod 755 ${SCRIPTS}/setenv.bash +. ${SCRIPTS}/setenv.bash #---------------------------------------------------------------------- #===================================================================================== From ab3f568fce2142eb3b2571daa1694df666a072a7 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 28 Oct 2025 19:14:54 +0000 Subject: [PATCH 34/72] on #833: many little modfications: 1. New compiler options: A new key was added to identify the compiler in use, for example, within setenv.bash, where the user must choose manually: # Choose your compiler here: export COMPILER=intel And a new general key was created in parallel to the existing one, as there are situations where the old key will still be useful, and some others where the new key will be necessary: # Set unique key: scheduler + host: export SYSTEM_KEY=PBS_ian export SYSTEM_KEYC=PBS_ian_ 2. Make rsync data fixed once: An if statement was also added to script 2 so that rsync is only performed once, checking whether the /datain/fixed folder exists before executing (or not) rsync. This prevents rsync from being executed every time, even when not necessary: if [ ! -d /fixed ] then echo -e \033[1;32m==>\033[0m copying and linking fixed input data ... \n mkdir -p rsync -rv --chmod=ugo=rw /p/monan/dados/MONAN_v1.4.x/MONAN_datain/datain/fixed rsync -rv --chmod=ugo=rwx /p/monan/dados/MONAN_v1.4.x/MONAN_data/execs ln -sf /p/monan/dados/MONAN_v1.4.x/MONAN_datain/datain/WPS_GEOG fi 3. Var DIR_SCRIPTS e DIR_DADOS in setenv.bash was corrected: In script 1, the DIR_SCRIPTS and DIR_DADOS variables were being automatically set incorrectly using the following commands: DIR_SCRIPTS should end up in the directory above the main scripts-CD-CT folder, and was going to scripts-CD-CT/scripts. This also required correcting the headers of all scripts, which were incorrectly pointing to: DIRHOMES=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian; and should be: DIRHOMES=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian/scripts_CD-CT; Fixed (only in scripts up to and including step 2. This fix remains to be applied to steps 3 and 4.). 4. Var NETCDF e PNETCDF inside of make-all.sh: The NETCDF and PNEDTCDF variables were being created within make-all.bash automatically but in a hard-coded format. This could be a problem if the user chose to recompile the model with another compiler. So I fixed it by placing the contents of NETCDF and PNEDTCDF as a variable in step 1 when creating make-all.sh: export NETCDF=${NETCDFDIR} export PNETCDF=${PNETCDFDIR} And in make-all.bash, after creation, it looks like this: export NETCDF=/opt/cray/pe/netcdf/4.9.0.15/INTEL/2023.2 export PNETCDF=/opt/cray/pe/parallel-netcdf/1.12.3.15/INTEL/2023.2 These variables will be used by the exported content within setenv.bash, which is executed just before compilation. 5. Some unnecessary echoes were removed. And also an extra script 3.run_model.bash_sylvio was removed. 6; Var GCCCIS was redefined, now inside of setenv_.bash export GCCCIS=/lustre/projetos/monan_adm/monan/CIs --- scripts/0.run_all.bash | 9 +- scripts/1.install_monan.bash | 10 +- scripts/2.pre_processing.bash | 17 +- scripts/3.run_model.bash_sylvio | 278 ------------------ scripts/make_degrib.bash | 88 +----- scripts/make_initatmos.bash | 3 +- scripts/make_static.bash | 7 +- scripts/setenv.bash | 17 +- scripts/stools/setenv_PBS.bash | 52 ---- ...PBS_ian.bash => setenv_PBS_ian_intel.bash} | 6 +- ...egeon.bash => setenv_SLURM_egeon_gnu.bash} | 1 + scripts/stools/submit_PBS.bash_TEMPLATE | 12 - 12 files changed, 45 insertions(+), 455 deletions(-) delete mode 100755 scripts/3.run_model.bash_sylvio delete mode 100755 scripts/stools/setenv_PBS.bash rename scripts/stools/{setenv_PBS_ian.bash => setenv_PBS_ian_intel.bash} (96%) rename scripts/stools/{setenv_SLURM_egeon.bash => setenv_SLURM_egeon_gnu.bash} (97%) delete mode 100755 scripts/stools/submit_PBS.bash_TEMPLATE diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index e834f94..76a9036 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -27,7 +27,7 @@ echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -45,8 +45,7 @@ convertmpas_branch=1.2.0 EXP=GFS RES=1024002 YYYYMMDDHHi=2025101900 -#FCST=24 -FCST=12 +FCST=24 #---------------------------------------------------------------------- @@ -55,8 +54,8 @@ FCST=12 #exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#exit +time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +exit # STEP 3: Executing the Model run: #time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 87262b9..a5b39d0 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -74,7 +74,7 @@ echo "---- Installing the Model ----" echo "" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -97,11 +97,11 @@ echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" # Local variables:----------------------------------------------------- -DIR_SCRIPTS=${SCRIPTS} MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} -$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$DIR_SCRIPTS;" setenv.bash) +$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) +$(sed -i "s;DIR_DADOS=.*$;DIR_DADOS=$(dirname $(dirname $(pwd)));" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) @@ -209,8 +209,8 @@ rm -f $MONANDIR/make*.output.atmosphere $MONANDIR/make*.output.init_atmosphere rm -fr $MONANDIR/src/core_atmosphere/inc $MONANDIR/src/core_init_atmosphere/inc DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") -export NETCDF=${NETCDFDIR} -export PNETCDF=${PNETCDFDIR} +export NETCDF=\${NETCDFDIR} +export PNETCDF=\${PNETCDFDIR} # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 4f08cb7..b2868cd 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -52,7 +52,7 @@ echo "" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -85,11 +85,14 @@ echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" git log | head -1 -echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEY}... \n" -mkdir -p ${DATAIN} -rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} +if [ ! -d ${DATAIN}/fixed ] +then + echo -e "${GREEN}==>${NC} copying and linking fixed input data ${SYSTEM_KEYC}... \n" + mkdir -p ${DATAIN} + rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} + 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:--------------- @@ -103,7 +106,6 @@ fi #---------------------------------------------------------------------------------- - # Degrib phase:--------------------------------------------------------------------- echo -e "${GREEN}==>${NC} Running Degrib:\n" time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} @@ -111,6 +113,7 @@ time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} + # Init Atmosphere phase:------------------------------------------------------------ echo -e "${GREEN}==>${NC} Running Init Atmosphere...\n" time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/3.run_model.bash_sylvio b/scripts/3.run_model.bash_sylvio deleted file mode 100755 index ce11a01..0000000 --- a/scripts/3.run_model.bash_sylvio +++ /dev/null @@ -1,278 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: run_model -# -# !DESCRIPTION: -# Script to run the MONAN model over the forecast horizon. -# -# Performs the following tasks: -# -# o VCheck all input files before -# o Creates the submition script -# o Submit the model -# o Veriffy all files generated -# -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} [EXP_NAME/OP] RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forecast example for 24km:" - echo "${0} GFS 1024002 2024010100 24" - echo "48 hour forecast example for 120km:" - echo "${0} GFS 40962 2024010100 48" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -echo "" -echo "---- Run Model ----" -echo "" - - -# Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} -DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} -SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=6 -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -cores=${MODEL_ncores} -hhi=${YYYYMMDDHHi:8:2} -NLEV=55 -CONFIG_CONV_INTERVAL="00:30:00" -VARTABLE=".OPER" -export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} -#------------------------------------------------------------------------------------ - -# Variables for flex outpout interval from streams.atmosphere------------------------ -t_strout=$(cat ${SCRIPTS}/namelists/streams.atmosphere.TEMPLATE | sed -n '//s/.*output_interval="\([^"]*\)".*/\1/p') -t_stroutsec=$(echo ${t_strout} | awk -F: '{print ($1 * 3600) + ($2 * 60) + $3}') -t_strouthor=$(echo "scale=4; (${t_stroutsec}/60)/60" | bc) -#------------------------------------------------------------------------------------ - -# Format to HH:MM:SS t_strout (output_interval) -IFS=":" read -r h m s <<< "${t_strout}" -printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" -# From now on, CONFI_LEN_DISP becames cte = 0.0, pickin up this value from static file. - -# Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - CONFIG_DT=150.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 2621442 ]; then #15Km - CONFIG_DT=90.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 40962 ]; then #120Km - CONFIG_DT=600.0 -elif [ $RES -eq 5898242 ]; then #10Km - CONFIG_DT=60.0 - CONFIG_LEN_DISP=10000.0 - CONFIG_CONV_INTERVAL="00:15:00" -fi -#------------------------------------------------------- - - -# Calculating final forecast dates in model namelist format: DD_HH:MM:SS -# using: start_date(yyyymmdd) + FCST(hh) : -ind=$(printf "%02d\n" $(echo "${FCST}/24" | bc)) -inh=$(printf "%02.0f\n" $(echo "((${FCST}/24)-${ind})*24" | bc -l)) -DD_HHMMSS_forecast=$(echo "${ind}_${inh}:00:00") - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - - -files_needed=("${SCRIPTS}/namelists/stream_list.atmosphere.output" ""${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} "${SCRIPTS}/namelists/stream_list.atmosphere.surface" "${EXECS}/atmosphere_model" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${DATAIN}/fixed/Vtable.GFS") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -cp -f ${EXECS}/atmosphere_model ${DIRRUN} -cp -f ${DATAIN}/fixed/*TBL ${DIRRUN} -cp -f ${DATAIN}/fixed/*DBL ${DIRRUN} -cp -f ${DATAIN}/fixed/*DATA ${DIRRUN} -cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} -cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} -cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${DIRRUN} -cp -f ${DATAIN}/fixed/Vtable.GFS ${DIRRUN} - - -if [ ${EXP} = "GFS" ] -then - sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; -s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g" \ - ${SCRIPTS}/namelists/namelist.atmosphere.TEMPLATE > ${DIRRUN}/namelist.atmosphere - - sed -e "s,#RES#,${RES},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ - ${SCRIPTS}/namelists/streams.atmosphere.TEMPLATE > ${DIRRUN}/streams.atmosphere -fi -cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} -cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} ${DIRRUN}/stream_list.atmosphere.diagnostics -cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.surface ${DIRRUN} -cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} -cp -f ${SCRIPTS}/stools/setenv_PBS_ian.bash ${DIRRUN} - - - -chmod 755 ${DIRRUN} - -rm -f ${DIRRUN}/model.bash - -if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] -then - sed -e "s,#JOBNAME#,${MODEL_jobname},g; - s,#NNODES#,${MODEL_nnodes},g; - s,#NTASKS#,${MODEL_ncores},g; - s,#NTASKSPNODE#,${MODEL_ncpn},g; - s,#PARTITION#,${MODEL_QUEUE},g; - s,#WALLTIME#,${MODEL_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o%j,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e%j,g" \ - ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/model.bash -else - echo "#!/bin/bash " > ${DIRRUN}/model.bash -fi - -cat << EOF0 >> ${DIRRUN}/model.bash -#!/bin/bash -x -#PBS -N ${MODEL_jobname} -#PBS -q ${MODEL_QUEUE} -#PBS -l select=${MODEL_nnodes}:ncpus=${MODEL_ncpn}:mpiprocs=${MODEL_ncpn} -#PBS -l walltime=${MODEL_walltime} -#PBS -o ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o${PBS_JOBID} -#PBS -e ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e${PBS_JOBID} -#PBS -l place=excl -#PBS -V -##PBS -l mem=500000 - - - - -export executable=atmosphere_model - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - -cd ${DIRRUN} -. setenv.bash -. setenv_PBS_ian.bash - - -date -time mpirun -np ${MODEL_ncores} ./\${executable} -date - -# -# move dataout, clean up and remove files/links -# -mv MONAN_DIAG_* ${DATAOUT}/${YYYYMMDDHHi}/Model -mv MONAN_HIST_* ${DATAOUT}/${YYYYMMDDHHi}/Model -cp -f ${EXECS}/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model -cp -f ${EXECS}/MONAN-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/ -cp -f ${DIRHOMES}/VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/SCRIPTSCDCT-VERSION.txt -cp -f ${MONANDIR}/README.md ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/ -mv log.atmosphere.*.out ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv log.atmosphere.*.err ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv namelist.atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv stream* ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -EOF0 -chmod a+x ${DIRRUN}/model.bash - - -case "${SCHEDULER_SYSTEM}" in - SLURM) - echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" - echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/logs... \n" - echo -e "sbatch ${SCRIPTS}/model.bash" - cd ${DIRRUN} - sbatch --wait ${DIRRUN}/model.bash - ;; - PBS) - echo "Rodando em PBS" - echo -e "${GREEN}==>${NC} Sbatch initatmos.bash...\n" - cd ${DIRRUN} - qsub -W block=true ${DIRRUN}/model.bash - ;; -# GENERIC) -# echo "Nenhum gerenciador detectado" -# cd ${DIRRUN} -# ${DIRRUN}/model.bash -# ;; -esac -mv ${DIRRUN}/model.bash ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - - -#-----Loop que verifica se os arquivos foram gerados corretamente (>0)----- -output_interval=${t_strouthor} -nfiles=$(echo "$FCST/$output_interval + 1" | bc) -for ii in $(seq 1 ${nfiles}) -do - i=$(printf "%04d" ${ii}) - hh=${YYYYMMDDHHi:8:2} - currentdate=$(date -d "${YYYYMMDDHHi:0:8} ${hh}:00:00 $(echo "(${i}-1)*${t_strout:0:2}" | bc) hours $(echo "(${i}-1)*${t_strout:3:2}" | bc) minutes $(echo "(${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") - file=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_${currentdate}.x${RES}L${NLEV}.nc - - if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} was not generated. \n" - exit -1 - fi - -done - -rm -fr ${DIRRUN} diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 64afe5c..e00d522 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -32,7 +32,7 @@ echo "---- Make Degrib ----" echo "" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -70,73 +70,8 @@ fi #CR: BNDDIR should be setted just for EGEON machine #CR: some local variables were mobed into the SLURM section, particularly for egeon -echo "system_key=$SYSTEM_KEY" -echo "operdir=$OPERDIR" - -case "${SYSTEM_KEY}" in - SLURM_egeon) - #CR: Here is the place to setup the CI directory into ${BNDDIR} var, - # to find the gfs file: - OPERDIREXP=${OPERDIR}/${EXP} - BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - GCCCIS=/mnt/beegfs/monan/CIs/${EXP} - ;; - PBS_ian) - #CR: Here is the place to setup the CI directory into ${BNDDIR} var, - # to find the gfs file: - echo "Rodando em PBS" - OPERDIREXP=${OPERDIR}/${EXP} - BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - GCCCIS=/p/monan/CIs/${EXP} - #GCCCIS=/p/monan/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} - #if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then - # echo "rsync OK!" - #else - # echo "rsync error!" - # echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" - # exit 1 - #fi - ;; - GENERIC) - #CR: Here is the place to setup the CI directory into ${BNDDIR} var, - # to find the gfs file: - echo "Nenhum gerenciador detectado" - # BNDDIR= - ;; -esac - - - - -#Fazendo download da condicao de contorno - -#if [ "$HOSTNAME" = "egeon" ]; then -# if rsync -rv --chmod=ugo=rw ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi}; then -# echo "rsync OK!" -# else -# echo "rsync error!" -# echo "Paths: ${GCCCIS}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 => ${DATAIN}/${YYYYMMDDHHi}" -# exit 1 -# fi -#else -# if [ ! -e "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then -# -# if wget "http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" \ -# -O "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2"; then -# echo "wget OK!" -# else -# echo "wget error!" -# echo "Link: http://dataserver.cptec.inpe.br/dataserver_dimnt/monan/MONAN-Model/monan_datain/CIs/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" -# exit 1 -# fi -# fi -#fi -#if [ ! -s "${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2" ]; then -# echo -e "${RED}==>${NC}Condicao de contorno inexistente !" -# echo -e "${RED}==>${NC}Check ${BNDDIR} or." -# echo -e "${RED}==>${NC}Check ${GCCCIS}" -# exit 1 -#fi +OPERDIREXP=${OPERDIR}/${EXP} +BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} # Se nao existir CI no diretorio do IO, @@ -144,21 +79,17 @@ esac #CR: maybe this if should belong to the SLURM kind of running... if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] then - if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] + if [ ! -s ${GCCCIS}/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] then echo -e "${RED}==>${NC}Condicao de contorno inexistente !" echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}" + echo -e "${RED}==>${NC}Check ${GCCCIS}/${EXP}" exit 1 else - BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} + BNDDIR=${GCCCIS}/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} fi fi -echo "hostname=$HOSTNAME" -echo "operdirexp=$OPERDIREXP" -echo "bnddir=$BNDDIR" -echo "gcccis=$GCCCIS" #files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") @@ -178,12 +109,8 @@ cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE - cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} - - +cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash @@ -275,7 +202,6 @@ case "${SCHEDULER_SYSTEM}" in sbatch --wait ${DIRRUN}/degrib.bash ;; PBS) - echo "Rodando em PBS" echo -e "${GREEN}==>${NC} qsub degrib.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/degrib.bash diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 6ac9e0f..5953dc3 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -31,7 +31,7 @@ echo "---- Make Init Atmosphere ----" echo "" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -171,7 +171,6 @@ case "${SCHEDULER_SYSTEM}" in sbatch --wait ${DIRRUN}/initatmos.bash ;; PBS) - echo "Rodando em PBS" echo -e "${GREEN}==>${NC} qsub initatmos.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/initatmos.bash diff --git a/scripts/make_static.bash b/scripts/make_static.bash index bb1da2f..db90301 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -31,7 +31,7 @@ echo "---- Make Static ----" echo "" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -93,11 +93,9 @@ done cp -f ${DATAIN}/fixed/*.TBL ${DIRRUN} cp -f ${DATAIN}/fixed/*.GFS ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} - cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.grid.nc ${DIRRUN} - sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC \ > ${DIRRUN}/namelist.init_atmosphere @@ -106,7 +104,6 @@ sed -e "s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/streams.init_atmosphere.STATIC \ > ${DIRRUN}/streams.init_atmosphere - cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} mkdir -p ${DATAOUT}/logs rm -f ${DIRRUN}/static.bash @@ -213,6 +210,6 @@ else echo -e "${RED}==>${NC} File ${DIRRUN}/x1.${RES}.static.nc was not created. \n" exit -1 fi -exit + rm -fr ${DIRRUN} diff --git a/scripts/setenv.bash b/scripts/setenv.bash index ee3b26a..5500371 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,6 +1,10 @@ #!/bin/bash - +# Choose your compiler here: +export COMPILER=intel +#export COMPILER=gnu +#export COMPILER=cray +#export COMPILER=nvidia # Squeduler detect: if command -v sbatch &> /dev/null @@ -32,13 +36,12 @@ case ${THOSTNAME} in export MAKE_TARG2=intel2-xd2000 ;; esac - - # Make the same for other machines/systems... echo "Host detected: $HOSTNAME" # Set unique key: scheduler + host: export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" +export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # Set environment variables and importants directories-------------------------------------------------- @@ -46,13 +49,13 @@ export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=/lustre/projetos/monan_adm/carlos.souza/scripts_CD-CT/scripts -export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/lustre/projetos/monan_adm/carlos.souza/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export DIR_SCRIPTS=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian +export DIR_DADOS=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian +export MONANDIR=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF # Load your system setenv: -. ${DIR_SCRIPTS}/stools/setenv_${SYSTEM_KEY}.bash +. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash #module list diff --git a/scripts/stools/setenv_PBS.bash b/scripts/stools/setenv_PBS.bash deleted file mode 100755 index 111da1b..0000000 --- a/scripts/stools/setenv_PBS.bash +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/bash - - -# Load modules: - - - - -# Submiting variables: - -# PRE-Static phase: -export STATIC_QUEUE="batch" -export STATIC_ncores=32 -export STATIC_nnodes=1 -export STATIC_ncpn=32 -export STATIC_jobname="Pre.static" -export STATIC_walltime="02:00:00" - -# PRE-Degrib phase: -export DEGRIB_QUEUE="batch" -export DEGRIB_ncores=1 -export DEGRIB_nnodes=1 -export DEGRIB_ncpn=1 -export DEGRIB_jobname="Pre.degrib" -### export DEGRIB_walltime="00:30:00" not used yet - using STATIC_walltime - -# PRE-Init Atmosphere phase: -export INITATMOS_QUEUE="batch" -export INITATMOS_ncores=64 -export INITATMOS_nnodes=1 -### export INITATMOS_ncpn=1 not used yet - using INITATMOS_ncores -export INITATMOS_jobname="Pre.InitAtmos" -### export INITATMOS_walltime="01:00:00" not used yet - using STATIC_walltime - - -# Model phase: -export MODEL_QUEUE="batch" -export MODEL_ncores=512 -export MODEL_nnodes=8 -export MODEL_ncpn=64 -export MODEL_jobname="Model.MONAN" -export MODEL_walltime="8:00:00" - - -# Post phase: -export POST_QUEUE="batch" -### export POST_ncores=1 not used yet -export POST_ncores=1 -export POST_nnodes=1 -export POST_ncpn=32 -export POST_jobname="Post.MONAN" -export POST_walltime="8:00:00" diff --git a/scripts/stools/setenv_PBS_ian.bash b/scripts/stools/setenv_PBS_ian_intel.bash similarity index 96% rename from scripts/stools/setenv_PBS_ian.bash rename to scripts/stools/setenv_PBS_ian_intel.bash index b323d75..864a85e 100755 --- a/scripts/stools/setenv_PBS_ian.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -7,7 +7,7 @@ module load craype-x86-turin module load cray-hdf5/1.14.3.3 module load cray-netcdf/4.9.0.15 module load cray-parallel-netcdf/1.12.3.15 -module load grads/2.2.1 +module load grads/2.2.1.oga.1 module load cdo/2.4.2 module load METIS/5.1.0 module load cray-pals @@ -79,8 +79,12 @@ export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} + + + export DIRDADOS=/p/monan/dados/MONAN_v1.4.x export OPERDIR=/oper/dados/ioper/tempo +export GCCCIS=/lustre/projetos/monan_adm/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL diff --git a/scripts/stools/setenv_SLURM_egeon.bash b/scripts/stools/setenv_SLURM_egeon_gnu.bash similarity index 97% rename from scripts/stools/setenv_SLURM_egeon.bash rename to scripts/stools/setenv_SLURM_egeon_gnu.bash index 6093820..e666e8a 100755 --- a/scripts/stools/setenv_SLURM_egeon.bash +++ b/scripts/stools/setenv_SLURM_egeon_gnu.bash @@ -70,3 +70,4 @@ export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} export DIRDADOS=/mnt/beegfs/monan/dados/MONAN_v1.4.x export OPERDIR=/oper/dados/ioper/tempo +export GCCCIS=/mnt/beegfs/monan/CIs diff --git a/scripts/stools/submit_PBS.bash_TEMPLATE b/scripts/stools/submit_PBS.bash_TEMPLATE deleted file mode 100755 index a3f2444..0000000 --- a/scripts/stools/submit_PBS.bash_TEMPLATE +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -#SBATCH --job-name=#JOBNAME# -#SBATCH --nodes=#NNODES# -#SBATCH --ntasks=#NTASKS# -#SBATCH --tasks-per-node=#NTASKSPNODE# -#SBATCH --partition=#PARTITION# -#SBATCH --time=#WALLTIME# -#SBATCH --output=#OUTPUTJOB# -#SBATCH --error=#ERRORJOB# -#SBATCH --exclusive - From 89044e2309b381d4301923a3542288c2446bb74f Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Tue, 28 Oct 2025 19:32:25 +0000 Subject: [PATCH 35/72] on #833: nThe new common data area was migrated and needed to be updated in the variables: export DIRDADOS=/lustre/projetos/monan_adm/monan/dados/MONAN_v1.4.x export GCCCIS=/lustre/projetos/monan_adm/monan/CIs in setenv_.bash --- scripts/0.run_all.bash | 2 +- scripts/make_static.bash | 1 - scripts/stools/setenv_PBS_ian_intel.bash | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 76a9036..c57d452 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -50,7 +50,7 @@ FCST=24 # STEP 1: Installing and compiling the A-MONAN model and utility programs: -#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} #exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: diff --git a/scripts/make_static.bash b/scripts/make_static.bash index db90301..452c05f 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -184,7 +184,6 @@ case "${SCHEDULER_SYSTEM}" in sbatch --wait ${DIRRUN}/static.bash ;; PBS) - echo "Rodando em PBS" echo -e "${GREEN}==>${NC} qsub static.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/static.bash diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index 864a85e..ae5e6f9 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -82,8 +82,8 @@ export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/p/monan/dados/MONAN_v1.4.x export OPERDIR=/oper/dados/ioper/tempo +export DIRDADOS=/lustre/projetos/monan_adm/monan/dados/MONAN_v1.4.x export GCCCIS=/lustre/projetos/monan_adm/monan/CIs From 3e406008cb42c464b603215e5fbe49f0aa9c32c7 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Wed, 29 Oct 2025 18:30:41 +0000 Subject: [PATCH 36/72] on #833: step 3 and 4 are tested OK! 10 days forecast post-processed in parallel posting, dependecy tested OK --- scripts/0.run_all.bash | 11 ++++------- scripts/3.run_model.bash | 5 +++-- scripts/make_template.bash | 2 +- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index c57d452..794985a 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -45,17 +45,17 @@ convertmpas_branch=1.2.0 EXP=GFS RES=1024002 YYYYMMDDHHi=2025101900 -FCST=24 +FCST=240 #---------------------------------------------------------------------- # STEP 1: Installing and compiling the A-MONAN model and utility programs: -time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} #exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -exit +#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#exit # STEP 3: Executing the Model run: #time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} @@ -64,8 +64,5 @@ exit # STEP 4: Executing the Post of Model run: time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#volta o dirname -#sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=\$(pwd)\ ;" setenv.bash -#sed -i "s;MONANDIR=.*$;MONANDIR=\$(pwd)\ ;" setenv.bash exit diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index e1e3dec..d5da0aa 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -47,7 +47,7 @@ echo "" # Standart directories variables:--------------------------------------- -DIRHOMES=$(dirname "$(pwd)"); mkdir -p ${DIRHOMES} +DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} @@ -239,7 +239,8 @@ case "${SCHEDULER_SYSTEM}" in sbatch --wait ${DIRRUN}/model.bash ;; PBS) - echo "Rodando em PBS" + echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" + echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/logs... \n" echo -e "${GREEN}==>${NC} qsub model.bash...\n" cd ${DIRRUN} qsub -W block=true ${DIRRUN}/model.bash diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 969ba76..e62fc4d 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -158,7 +158,7 @@ timectl=$(grep tdef ${DIRRUN}/qctlinfo.ctl | cut -d" " -f4) sed -i '3a\options template' ${DIRRUN}/qctlinfo.ctl sed -i "/tdef/c\tdef ${nfiles} linear ${timectl} ${t_stroutmin}mn" ${DIRRUN}/qctlinfo.ctl sed -i "/dset/c\dset ^${diag_name_templ}" ${DIRRUN}/qctlinfo.ctl -exit + chmod 755 ${DIRRUN}/* mv ${DIRRUN}/qctlinfo.ctl ${DATAOUT}/${YYYYMMDDHHi}/Post/${diag_name_post}.template.ctl rm -fr ${DIRRUN} From 6f63dcfb52deabc5888c2f0903c99595906062e0 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Fri, 31 Oct 2025 19:23:35 +0000 Subject: [PATCH 37/72] on #833: return of export DIR_SCRIPTS=/lustre/projetos/monan_adm/carlos.souza/issues in setenv.bash. just a test. not valided yet. --- scripts/0.run_all.bash | 4 ++-- scripts/1.install_monan.bash | 8 ++++---- scripts/setenv.bash | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 794985a..f1593b4 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -50,8 +50,8 @@ FCST=240 # STEP 1: Installing and compiling the A-MONAN model and utility programs: -#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} -#exit +time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: #time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index a5b39d0..8b260c4 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 #-----------------------------------------------------------------------------# # !SCRIPT: install_monan @@ -100,13 +101,12 @@ echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} -$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) -$(sed -i "s;DIR_DADOS=.*$;DIR_DADOS=$(dirname $(dirname $(pwd)));" setenv.bash) +#$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) +#$(sed -i "s;DIR_DADOS=.*$;DIR_DADOS=$(dirname $(dirname $(pwd)));" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) - - chmod 755 ${SCRIPTS}/setenv.bash . ${SCRIPTS}/setenv.bash + #---------------------------------------------------------------------- #===================================================================================== diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 5500371..4857ec3 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -49,8 +49,8 @@ export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # MONAN-suite install root directories: # Put your directories: -export DIR_SCRIPTS=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian -export DIR_DADOS=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian +export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) +export DIR_DADOS=${DIR_SCRIPTS} export MONANDIR=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF From 48196b2432ff22ddcb0abdcaddf7a68557949737 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Fri, 31 Oct 2025 19:31:53 +0000 Subject: [PATCH 38/72] on 833: umask 022 added in all scripts. Please, teste it! --- scripts/0.run_all.bash | 8 ++++---- scripts/2.pre_processing.bash | 1 + scripts/3.run_model.bash | 1 + scripts/4.run_post.bash | 1 + scripts/link_grib.csh | 1 + scripts/make_degrib.bash | 1 + scripts/make_initatmos.bash | 1 + scripts/make_static.bash | 1 + scripts/make_template.bash | 1 + scripts/setenv.bash | 1 + scripts/stools/setenv_GENERIC.bash | 1 + scripts/stools/setenv_PBS_ian_intel.bash | 1 + scripts/stools/setenv_SLURM_egeon_gnu.bash | 1 + scripts/stools/submit_PBS_ian.bash_TEMPLATE | 1 + scripts/stools/submit_SLURM_egeon.bash_TEMPLATE | 1 + 15 files changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index f1593b4..f39defe 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -50,12 +50,12 @@ FCST=240 # STEP 1: Installing and compiling the A-MONAN model and utility programs: -time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} -exit +#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +#exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#exit +time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +exit # STEP 3: Executing the Model run: #time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index b2868cd..baba5e6 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 #-----------------------------------------------------------------------------# # !SCRIPT: pre_processing # diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index d5da0aa..e141be3 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 #-----------------------------------------------------------------------------# # !SCRIPT: run_model # diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index f03e1a7..eeb4586 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 #-----------------------------------------------------------------------------# # !SCRIPT: run_post # diff --git a/scripts/link_grib.csh b/scripts/link_grib.csh index 661d8eb..e02bbf4 100755 --- a/scripts/link_grib.csh +++ b/scripts/link_grib.csh @@ -1,4 +1,5 @@ #!/bin/csh -f +umask 022 set alpha = ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) set i1 = 1 diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index e00d522..8d7bd11 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 if [ $# -ne 4 ] diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 5953dc3..de32685 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 if [ $# -ne 4 ] diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 452c05f..e7a59e3 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 if [ $# -ne 4 ] diff --git a/scripts/make_template.bash b/scripts/make_template.bash index e62fc4d..2d6abf4 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 #-----------------------------------------------------------------------------# # !SCRIPT: run_post # diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 4857ec3..8399900 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 # Choose your compiler here: export COMPILER=intel diff --git a/scripts/stools/setenv_GENERIC.bash b/scripts/stools/setenv_GENERIC.bash index 5c609a6..c0063f6 100755 --- a/scripts/stools/setenv_GENERIC.bash +++ b/scripts/stools/setenv_GENERIC.bash @@ -1,3 +1,4 @@ #!/bin/bash +umask 022 diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index ae5e6f9..d6bb01b 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 # Load modules: module purge diff --git a/scripts/stools/setenv_SLURM_egeon_gnu.bash b/scripts/stools/setenv_SLURM_egeon_gnu.bash index e666e8a..6bbb1a9 100755 --- a/scripts/stools/setenv_SLURM_egeon_gnu.bash +++ b/scripts/stools/setenv_SLURM_egeon_gnu.bash @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 # Load modules: diff --git a/scripts/stools/submit_PBS_ian.bash_TEMPLATE b/scripts/stools/submit_PBS_ian.bash_TEMPLATE index 6769b75..f6d0be6 100755 --- a/scripts/stools/submit_PBS_ian.bash_TEMPLATE +++ b/scripts/stools/submit_PBS_ian.bash_TEMPLATE @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 ####PBS -l select=:ncpus=:mpiprocs=:ompthreads= diff --git a/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE b/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE index 3ffe9a6..8503a63 100755 --- a/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE +++ b/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE @@ -1,4 +1,5 @@ #!/bin/bash +umask 022 #SBATCH --job-name=#JOBNAME# #SBATCH --nodes=#NNODES# From 98a6c1a980bd7fdcbfa5f62d86c108fc65578a68 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Fri, 31 Oct 2025 19:37:59 +0000 Subject: [PATCH 39/72] on 833: umaks removed from setenvs scripts, mostly inside stools dir., still testing... --- scripts/link_grib.csh | 1 - scripts/stools/setenv_GENERIC.bash | 1 - scripts/stools/setenv_PBS_ian_intel.bash | 1 - scripts/stools/setenv_SLURM_egeon_gnu.bash | 1 - scripts/stools/submit_PBS_ian.bash_TEMPLATE | 1 - scripts/stools/submit_SLURM_egeon.bash_TEMPLATE | 1 - 6 files changed, 6 deletions(-) diff --git a/scripts/link_grib.csh b/scripts/link_grib.csh index e02bbf4..661d8eb 100755 --- a/scripts/link_grib.csh +++ b/scripts/link_grib.csh @@ -1,5 +1,4 @@ #!/bin/csh -f -umask 022 set alpha = ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) set i1 = 1 diff --git a/scripts/stools/setenv_GENERIC.bash b/scripts/stools/setenv_GENERIC.bash index c0063f6..5c609a6 100755 --- a/scripts/stools/setenv_GENERIC.bash +++ b/scripts/stools/setenv_GENERIC.bash @@ -1,4 +1,3 @@ #!/bin/bash -umask 022 diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index d6bb01b..ae5e6f9 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -1,5 +1,4 @@ #!/bin/bash -umask 022 # Load modules: module purge diff --git a/scripts/stools/setenv_SLURM_egeon_gnu.bash b/scripts/stools/setenv_SLURM_egeon_gnu.bash index 6bbb1a9..e666e8a 100755 --- a/scripts/stools/setenv_SLURM_egeon_gnu.bash +++ b/scripts/stools/setenv_SLURM_egeon_gnu.bash @@ -1,5 +1,4 @@ #!/bin/bash -umask 022 # Load modules: diff --git a/scripts/stools/submit_PBS_ian.bash_TEMPLATE b/scripts/stools/submit_PBS_ian.bash_TEMPLATE index f6d0be6..6769b75 100755 --- a/scripts/stools/submit_PBS_ian.bash_TEMPLATE +++ b/scripts/stools/submit_PBS_ian.bash_TEMPLATE @@ -1,5 +1,4 @@ #!/bin/bash -umask 022 ####PBS -l select=:ncpus=:mpiprocs=:ompthreads= diff --git a/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE b/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE index 8503a63..3ffe9a6 100755 --- a/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE +++ b/scripts/stools/submit_SLURM_egeon.bash_TEMPLATE @@ -1,5 +1,4 @@ #!/bin/bash -umask 022 #SBATCH --job-name=#JOBNAME# #SBATCH --nodes=#NNODES# From a1e69d9afa71e571b3fc3a07cc202656214a57a0 Mon Sep 17 00:00:00 2001 From: carlosrenatosouza2 Date: Fri, 31 Oct 2025 17:05:09 -0300 Subject: [PATCH 40/72] on #833: The COMPILER variable is now created within the hostname case structure. This was done until new compilers are adjusted in ian, and also to avoid errors for unsuspecting users when using egeon and/or ian: # Identifying several names of the egeon: case in egeon-login|headnode|n[0-9]|n[1-2][0-9]|n3[0-3]) export HOSTNAME=egeon export MAKE_TARG=gfortran export MAKE_TARG2=gfortran export COMPILER=gnu ;; ian[0-9]*|cn-0[0-9][0-9][0-9]) export HOSTNAME=ian export MAKE_TARG=intel-xd2000 export MAKE_TARG2=intel2-xd2000 export COMPILER=intel ;; esac --- scripts/0.run_all.bash | 8 ++++---- scripts/setenv.bash | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index f39defe..1e619e8 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -54,12 +54,12 @@ FCST=240 #exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -exit +#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +#exit # STEP 3: Executing the Model run: -#time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#exit +time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +exit # STEP 4: Executing the Post of Model run: time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 8399900..4ceaabf 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -2,7 +2,7 @@ umask 022 # Choose your compiler here: -export COMPILER=intel +#export COMPILER=intel #export COMPILER=gnu #export COMPILER=cray #export COMPILER=nvidia @@ -30,15 +30,18 @@ case ${THOSTNAME} in export HOSTNAME="egeon" export MAKE_TARG=gfortran export MAKE_TARG2=gfortran + export COMPILER=gnu ;; ian[0-9]*|cn-0[0-9][0-9][0-9]) export HOSTNAME="ian" export MAKE_TARG=intel-xd2000 export MAKE_TARG2=intel2-xd2000 + export COMPILER=intel ;; esac # Make the same for other machines/systems... echo "Host detected: $HOSTNAME" +echo "Compiler to be used: ${COMPILER}" # Set unique key: scheduler + host: export SYSTEM_KEY="${SCHEDULER_SYSTEM}_${HOSTNAME}" @@ -52,7 +55,7 @@ export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=${DIR_SCRIPTS} -export MONANDIR=/lustre/projetos/monan_adm/carlos.souza/issues/833-scripts-cdct-teste-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export MONANDIR=/mnt/beegfs/carlos.souza/issues/833-scripts-cdct-teste-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF # Load your system setenv: From b5e804395c89e1914cc375537ebe47355f02de27 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Mon, 3 Nov 2025 19:52:34 +0000 Subject: [PATCH 41/72] on833 uncomment the line on script 1.install_monan.bash --- scripts/1.install_monan.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 8b260c4..06b5067 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -101,7 +101,7 @@ echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} -#$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) +$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) #$(sed -i "s;DIR_DADOS=.*$;DIR_DADOS=$(dirname $(dirname $(pwd)));" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) chmod 755 ${SCRIPTS}/setenv.bash From b8479c78d64b317a844d40df1731873ecc53d958 Mon Sep 17 00:00:00 2001 From: netosylvio Date: Tue, 11 Nov 2025 19:20:17 +0000 Subject: [PATCH 42/72] fixed setenv call on make-all.bash , fixed 4.run_post for variable current_date and diag_name --- scripts/1.install_monan.bash | 6 +++--- scripts/4.run_post.bash | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 06b5067..7eb88a2 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -101,7 +101,7 @@ echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} -$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) +#$(sed -i "s;DIR_SCRIPTS=.*$;DIR_SCRIPTS=$(dirname $(dirname $(pwd)));" setenv.bash) #$(sed -i "s;DIR_DADOS=.*$;DIR_DADOS=$(dirname $(dirname $(pwd)));" setenv.bash) $(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) chmod 755 ${SCRIPTS}/setenv.bash @@ -199,9 +199,9 @@ cat << EOF > make-all.sh # PRECISION=single - builds with default single-precision real kind. Default is to use double-precision. # SHAREDLIB=true - generate position-independent code suitable for use in a shared library. Default is false. - +cd ${SCRIPTS} . ${SCRIPTS}/setenv.bash - +cd $MONANDIR rm -rf $MONANDIR/default_inputs/ $MONANDIR/src/core_atmosphere/physics/physics_wrf/files rm -f $MONANDIR/stream_list.* $MONANDIR/streams.* $MONANDIR/namelist.* diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index eeb4586..38bfc0d 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -241,9 +241,9 @@ for ii in \$(seq ${inicio} ${fim}) do i=\$(printf "%04d" \${ii}) hh=${YYYYMMDDHHi:8:2} - currentdate=\$(date -d "${YYYYMMDDHHi:0:8} \${hh}:00 \$(echo "(\${i}-1)*3" | bc) hours" +"%Y%m%d%H") - diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.00.00.x${RES}L${N_MODEL_LEV}.nc - + currentdate=\$(date -d "${YYYYMMDDHHi:0:8} \${hh}:00:00 \$(echo "(\${i}-1)*${t_strout:0:2}" | bc) hours \$(echo "(\${i}-1)*${t_strout:3:2}" | bc) minutes \$(echo "(\${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") + diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc + cd ${DIRRUN}/dir.\${i} chmod 755 * cp latlon.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/\${diag_name_post} >> convert_mpas.output & From f2f06705fbaa895d93de207c7c9a83297b4ac1d5 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Tue, 25 Nov 2025 08:16:20 -0300 Subject: [PATCH 43/72] #855: Including configurations for 30 and 60km of resolution. --- scripts/3.run_model.bash | 4 ++++ scripts/4.run_post.bash | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index e141be3..8b03d20 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -97,6 +97,10 @@ elif [ $RES -eq 2621442 ]; then #15Km CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 40962 ]; then #120Km CONFIG_DT=600.0 +elif [ $RES -eq 163842 ]; then #60Km + CONFIG_DT=300.0 +elif [ $RES -eq 655362 ]; then #30Km + CONFIG_DT=150.0 elif [ $RES -eq 5898242 ]; then #10Km CONFIG_DT=60.0 CONFIG_LEN_DISP=10000.0 diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 38bfc0d..a65efb8 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -109,6 +109,20 @@ elif [ $RES -eq 40962 ]; then #120Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [ $RES -eq 163842 ]; then #60Km + NLAT=301 #180/0.6 + NLON=601 #360/0.6 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 655362 ]; then #30Km + NLAT=601 #180/0.3 + NLON=1201 #360/0.3 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 elif [ $RES -eq 5898242 ]; then #10Km NLAT=1801 #180/0.10 (+1) NLON=3601 #360/0.10 (+1) From b92cdc68462c6909447f4dc237b1e4d861acf793 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 28 Nov 2025 18:32:05 +0000 Subject: [PATCH 44/72] #854: including io_type=pnetcdf,cdf5 in the streams' templates. --- scripts/namelists/streams.atmosphere.TEMPLATE | 3 +++ scripts/namelists/streams.init_atmosphere.TEMPLATE | 2 ++ 2 files changed, 5 insertions(+) diff --git a/scripts/namelists/streams.atmosphere.TEMPLATE b/scripts/namelists/streams.atmosphere.TEMPLATE index c732433..04def1c 100755 --- a/scripts/namelists/streams.atmosphere.TEMPLATE +++ b/scripts/namelists/streams.atmosphere.TEMPLATE @@ -1,11 +1,13 @@ @@ -20,6 +22,7 @@ diff --git a/scripts/namelists/streams.init_atmosphere.TEMPLATE b/scripts/namelists/streams.init_atmosphere.TEMPLATE index 10c9e91..1a2fd34 100755 --- a/scripts/namelists/streams.init_atmosphere.TEMPLATE +++ b/scripts/namelists/streams.init_atmosphere.TEMPLATE @@ -1,11 +1,13 @@ From 6e36800a774b93a1e53c0c6d5a1169a4e36bf6d7 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 28 Nov 2025 18:37:34 +0000 Subject: [PATCH 45/72] #854: including environmental configurations for gnu compiler in the ian PBS system. --- scripts/stools/setenv_PBS_ian_gnu.bash | 125 +++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100755 scripts/stools/setenv_PBS_ian_gnu.bash diff --git a/scripts/stools/setenv_PBS_ian_gnu.bash b/scripts/stools/setenv_PBS_ian_gnu.bash new file mode 100755 index 0000000..7b44fff --- /dev/null +++ b/scripts/stools/setenv_PBS_ian_gnu.bash @@ -0,0 +1,125 @@ +#!/bin/bash + +# Load modules: +module purge +module load PrgEnv-gnu +module load craype-x86-turin +module load xpmem/0.2.119-1.3_gef379be13330 +module load grads/2.2.1.oga.1 +module load cdo/2.4.2 +module load METIS/5.1.0 +module load cray-pals +module list + + +# Submiting variables: + +# PRE-Static phase: +export STATIC_QUEUE="pesqextra" +export STATIC_ncores=128 +export STATIC_nnodes=4 +export STATIC_ncpus=32 +export STATIC_ncpn=32 +export STATIC_nthreads=1 +export STATIC_jobname="Pre.static" +export STATIC_walltime="02:00:00" + + +# PRE-Degrib phase: +export DEGRIB_QUEUE="pesqextra" +export DEGRIB_ncores=1 +export DEGRIB_nnodes=1 +export DEGRIB_ncpus=1 +export DEGRIB_ncpn=1 +export DEGRIB_nthreads=1 +export DEGRIB_jobname="Pre.degrib" +export DEGRIB_walltime="02:00:00" + +# PRE-Init Atmosphere phase: +export INITATMOS_QUEUE="pesqextra" +export INITATMOS_ncores=512 +export INITATMOS_nnodes=4 +export INITATMOS_ncpus=128 +export INITATMOS_ncpn=128 +export INITATMOS_nthreads=1 +export INITATMOS_jobname="Pre.InitAtmos" +export INITATMOS_walltime="02:00:00" + +# Model phase: +export MODEL_QUEUE="pesqextra" +export MODEL_ncores=8192 +export MODEL_nnodes=32 +export MODEL_ncpus=256 +export MODEL_ncpn=256 +export MODEL_nthreads=1 +export MODEL_jobname="Model.MONAN" +export MODEL_walltime="8:00:00" +#PBS -l select=8:ncpus=64:mpiprocs=64 == 512mpi, 8nodes, 64cpn +#PBS -l select=16:ncpus=64:mpiprocs=64 == 1024mpi, 16nodes, 64cpn + +# Post phase: +export POST_QUEUE="pesqextra" +export POST_ncores=32 +export POST_nnodes=1 +export POST_ncpus=32 +export POST_ncpn=32 +export POST_nthreads=1 +export POST_jobname="Post.MONAN" +export POST_walltime="8:00:00" + + +# Libraries paths: +#export PIO=${PIO_ROOT} +#export NETCDF=${NETCDF_DIR} +#export PNETCDF=${PNETCDF_DIR} +export PIO=/lustre/projetos/monan_adm/eduardo.khamis/libs_gnu/source/installLibs +export NETCDF=/lustre/projetos/monan_adm/eduardo.khamis/libs_gnu/source/installLibs +export PNETCDF=/lustre/projetos/monan_adm/eduardo.khamis/libs_gnu/source/installLibs +export PIODIR=${PIO} +export NETCDFDIR=${NETCDF} +export PNETCDFDIR=${PNETCDF} + + +export OPERDIR=/oper/dados/ioper/tempo +export DIRDADOS=/lustre/projetos/monan_adm/monan/dados/MONAN_v1.4.x +export GCCCIS=/lustre/projetos/monan_adm/monan/CIs + + +# PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL +#export PIO= +export LD_LIBRARY_PATH=$NETCDF/lib64:$PNETCDF/lib64:$PIO/lib64:$LD_LIBRARY_PATH + + +# +# -------- Tested Configurations --------- +# + +#export MODEL_ncores=8192 +#export MODEL_nnodes=32 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=7680 +#export MODEL_nnodes=30 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=1024 +#export MODEL_nnodes=16 +#export MODEL_ncpus=256 +#export MODEL_ncpn=64 +#export MODEL_nthreads=4 + +#export MODEL_ncores=4096 +#export MODEL_nnodes=20 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=6144 +#export MODEL_nnodes=24 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 From 885f02e94500c85a4d007d80d9f6959a76b37608 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 28 Nov 2025 18:51:09 +0000 Subject: [PATCH 46/72] #854: including environmental configurations for gnu compiler in the ian PBS system. --- scripts/1.install_monan.bash | 4 ++-- scripts/3.run_model.bash | 2 ++ scripts/setenv.bash | 17 +++++++++++------ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 7eb88a2..5e32b79 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -212,7 +212,7 @@ DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") export NETCDF=\${NETCDFDIR} export PNETCDF=\${PNETCDFDIR} # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL -export PIO= +export PIO=\${PIODIR} MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" @@ -258,7 +258,7 @@ echo -e "${GREEN}==>${NC} Installing init_atmosphere_model and atmosphere_model echo "" . ${MONANDIR}/make-all.sh - +export PATH=$NETCDF/bin:$PATH # install convert_mpas echo "" diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 8b03d20..8aad1e7 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -205,6 +205,8 @@ ulimit -s unlimited cd ${DIRRUN} . ${SCRIPTS}/setenv.bash +export FI_CXI_RX_MATCH_MODE=hybrid + date beg_secs=\`date +"%s"\` diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 4ceaabf..b4a6f83 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -32,11 +32,16 @@ case ${THOSTNAME} in export MAKE_TARG2=gfortran export COMPILER=gnu ;; +# ian[0-9]*|cn-0[0-9][0-9][0-9]) +# export HOSTNAME="ian" +# export MAKE_TARG=intel-xd2000 +# export MAKE_TARG2=intel2-xd2000 +# export COMPILER=intel ian[0-9]*|cn-0[0-9][0-9][0-9]) export HOSTNAME="ian" - export MAKE_TARG=intel-xd2000 - export MAKE_TARG2=intel2-xd2000 - export COMPILER=intel + export MAKE_TARG=gfortran-xd2000 + export MAKE_TARG2=gfortran-xd2000 + export COMPILER=gnu ;; esac # Make the same for other machines/systems... @@ -55,12 +60,12 @@ export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=${DIR_SCRIPTS} -export MONANDIR=/mnt/beegfs/carlos.souza/issues/833-scripts-cdct-teste-ian/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export MONANDIR=/lustre/projetos/monan_adm/eduardo.khamis/issues/854/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF # Load your system setenv: -. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash - +#. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash +. /lustre/projetos/monan_adm/eduardo.khamis/issues/854/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash #module list #echo "" From c88f43c657cf66f9a40687c7df7b13573bece8fc Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 28 Nov 2025 19:37:14 +0000 Subject: [PATCH 47/72] #854: removing PIO2 compilation to preserve compatibility with the SLURM system. --- scripts/1.install_monan.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 5e32b79..0e44aac 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -212,12 +212,14 @@ DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") export NETCDF=\${NETCDFDIR} export PNETCDF=\${PNETCDFDIR} # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL -export PIO=\${PIODIR} +#export PIO=\${PIODIR} +export PIO= 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} @@ -233,6 +235,7 @@ 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} From 6269f993931471d87c5d81c1292ced6c1c3f6f96 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 28 Nov 2025 21:47:04 +0000 Subject: [PATCH 48/72] #854: including environmental configurations for gnu compiler in the ian PBS system. --- scripts/setenv.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/setenv.bash b/scripts/setenv.bash index b4a6f83..099bc2a 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -64,8 +64,7 @@ export MONANDIR=/lustre/projetos/monan_adm/eduardo.khamis/issues/854/scripts_CD- # Load your system setenv: -#. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash -. /lustre/projetos/monan_adm/eduardo.khamis/issues/854/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash +. ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stools/setenv_${SYSTEM_KEYC}.bash #module list #echo "" From d17697d0c5556e795826f64a138f6f5c2e4cf791 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Fri, 28 Nov 2025 20:05:48 -0300 Subject: [PATCH 49/72] #854: convert_mpas compilation resolved to work at Egeon and Jaci --- scripts/1.install_monan.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 0e44aac..9ea5b7a 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -261,7 +261,10 @@ echo -e "${GREEN}==>${NC} Installing init_atmosphere_model and atmosphere_model echo "" . ${MONANDIR}/make-all.sh -export PATH=$NETCDF/bin:$PATH +if [ "$HOSTNAME" == "ian" ]; then +# echo "hostname=$HOSTNAME" + export PATH=$NETCDF/bin:$PATH +fi # install convert_mpas echo "" From 502ae07463f46c9334092c4fa3c21c809a90ee92 Mon Sep 17 00:00:00 2001 From: egkhamis Date: Mon, 1 Dec 2025 11:48:58 +0000 Subject: [PATCH 50/72] #854: including environmental configurations for gnu compiler in the ian PBS system. --- scripts/setenv.bash | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 099bc2a..7e680d0 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -3,7 +3,7 @@ umask 022 # Choose your compiler here: #export COMPILER=intel -#export COMPILER=gnu +export COMPILER=gnu #export COMPILER=cray #export COMPILER=nvidia @@ -30,18 +30,16 @@ case ${THOSTNAME} in export HOSTNAME="egeon" export MAKE_TARG=gfortran export MAKE_TARG2=gfortran - export COMPILER=gnu ;; -# ian[0-9]*|cn-0[0-9][0-9][0-9]) -# export HOSTNAME="ian" -# export MAKE_TARG=intel-xd2000 -# export MAKE_TARG2=intel2-xd2000 -# export COMPILER=intel ian[0-9]*|cn-0[0-9][0-9][0-9]) export HOSTNAME="ian" - export MAKE_TARG=gfortran-xd2000 - export MAKE_TARG2=gfortran-xd2000 - export COMPILER=gnu + if [ "$COMPILER" == "intel" ]; then + export MAKE_TARG=intel-xd2000 + export MAKE_TARG2=intel2-xd2000 + elif [ "$COMPILER" == "gnu" ]; then + export MAKE_TARG=gfortran-xd2000 + export MAKE_TARG2=gfortran-xd2000 + fi ;; esac # Make the same for other machines/systems... From 79b2a9abcc51b57c35af8933c2847c4e2ffc61a6 Mon Sep 17 00:00:00 2001 From: Joao Messias Date: Thu, 22 Jan 2026 01:37:53 +0000 Subject: [PATCH 51/72] Updates for the new version - 1.4.0; Compatibility with MONAN 1.4.3-rc; Support for multi-environment Jaci (intel and gnu) and Egeon (gnu) --- README.md | 17 +- VERSION.txt | 2 +- scripts.pomerode/0.run_all_first_time.bash | 64 ---- scripts.pomerode/1.install_monan.bash | 292 --------------- scripts.pomerode/2.pre_processing.bash | 137 ------- scripts.pomerode/3.run_model.bash | 248 ------------ scripts.pomerode/4.run_post.bash | 306 --------------- scripts.pomerode/5.run_products.bash | 155 -------- scripts.pomerode/6.do_manut.bash | 94 ----- scripts.pomerode/group_levels.py | 107 ------ scripts.pomerode/link_grib.csh | 62 --- scripts.pomerode/make_degrib.bash | 188 ---------- scripts.pomerode/make_initatmos.bash | 160 -------- scripts.pomerode/make_static.bash | 174 --------- scripts.pomerode/requirements.txt | 2 - scripts.pomerode/run_past2now.bash | 18 - scripts.pomerode/setenv.bash | 187 ---------- scripts.pomerode/setenv_python.bash | 17 - scripts.sdumont2/0.run_all_first_time.bash | 64 ---- scripts.sdumont2/1.install_monan.bash | 289 -------------- scripts.sdumont2/2.pre_processing.bash | 137 ------- scripts.sdumont2/3.run_model.bash | 247 ------------ scripts.sdumont2/4.run_post.bash | 306 --------------- scripts.sdumont2/5.run_products.bash | 155 -------- scripts.sdumont2/6.do_manut.bash | 94 ----- scripts.sdumont2/group_levels.py | 107 ------ scripts.sdumont2/link_grib.csh | 62 --- scripts.sdumont2/make_degrib.bash | 187 ---------- scripts.sdumont2/make_initatmos.bash | 159 -------- scripts.sdumont2/make_static.bash | 173 --------- scripts.sdumont2/requirements.txt | 2 - scripts.sdumont2/run_past2now.bash | 18 - scripts.sdumont2/setenv.bash | 183 --------- scripts.sdumont2/setenv_python.bash | 17 - .../utils/install_libs_and_pio.bash | 352 ------------------ scripts.sdumont2/utils/install_ungrib.bash | 81 ---- .../utils/setenv_libs_and_pio.bash | 39 -- scripts/0.run_all.bash | 18 +- scripts/1.install_monan.bash | 4 +- scripts/3.run_model.bash | 8 +- scripts/make_initatmos.bash | 2 + scripts/make_static.bash | 2 + .../namelists/namelist.atmosphere.TEMPLATE | 2 +- scripts/setenv.bash | 14 +- scripts/stools/setenv_PBS_ian_gnu.bash | 36 +- scripts/stools/setenv_PBS_ian_intel.bash | 26 +- scripts/stools/setenv_SLURM_egeon_gnu.bash | 13 + 47 files changed, 85 insertions(+), 4942 deletions(-) delete mode 100755 scripts.pomerode/0.run_all_first_time.bash delete mode 100755 scripts.pomerode/1.install_monan.bash delete mode 100755 scripts.pomerode/2.pre_processing.bash delete mode 100755 scripts.pomerode/3.run_model.bash delete mode 100755 scripts.pomerode/4.run_post.bash delete mode 100755 scripts.pomerode/5.run_products.bash delete mode 100755 scripts.pomerode/6.do_manut.bash delete mode 100755 scripts.pomerode/group_levels.py delete mode 100755 scripts.pomerode/link_grib.csh delete mode 100755 scripts.pomerode/make_degrib.bash delete mode 100755 scripts.pomerode/make_initatmos.bash delete mode 100755 scripts.pomerode/make_static.bash delete mode 100755 scripts.pomerode/requirements.txt delete mode 100755 scripts.pomerode/run_past2now.bash delete mode 100755 scripts.pomerode/setenv.bash delete mode 100755 scripts.pomerode/setenv_python.bash delete mode 100755 scripts.sdumont2/0.run_all_first_time.bash delete mode 100755 scripts.sdumont2/1.install_monan.bash delete mode 100755 scripts.sdumont2/2.pre_processing.bash delete mode 100755 scripts.sdumont2/3.run_model.bash delete mode 100755 scripts.sdumont2/4.run_post.bash delete mode 100755 scripts.sdumont2/5.run_products.bash delete mode 100755 scripts.sdumont2/6.do_manut.bash delete mode 100755 scripts.sdumont2/group_levels.py delete mode 100755 scripts.sdumont2/link_grib.csh delete mode 100755 scripts.sdumont2/make_degrib.bash delete mode 100755 scripts.sdumont2/make_initatmos.bash delete mode 100755 scripts.sdumont2/make_static.bash delete mode 100755 scripts.sdumont2/requirements.txt delete mode 100755 scripts.sdumont2/run_past2now.bash delete mode 100755 scripts.sdumont2/setenv.bash delete mode 100755 scripts.sdumont2/setenv_python.bash delete mode 100755 scripts.sdumont2/utils/install_libs_and_pio.bash delete mode 100755 scripts.sdumont2/utils/install_ungrib.bash delete mode 100755 scripts.sdumont2/utils/setenv_libs_and_pio.bash diff --git a/README.md b/README.md index ea64e84..9a984fc 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# MONAN - Model for Ocean-laNd-Atmosphere PredictioN +# Scripts CD-CT (Continuos Deployment & Continuous Testing) for MONAN (Model for Ocean-laNd-Atmosphere PredictioN) -### *Continuous Deployment & Continuous Testing (CD-CT) for MONAN at Egeon* +## History -This folder aims to create a version for testing MONAN with GFS at Egeon. - -## 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. @@ -62,7 +62,7 @@ This folder aims to create a version for testing MONAN with GFS at Egeon. - 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. -### Implementation at Egeon: +## Get Started **Getting the scritps:** @@ -91,8 +91,8 @@ You will need to execute only 6 steps scripts, so you can run the Atmospheric MO Default values: ~~~ - = "1.0.0" - = "1.0.0" + = "1.4.3-rc" + = "1.2.0" ~~~ - This first step will create a standart diretories structures for work: @@ -114,7 +114,6 @@ Where: - `dataout\Pre\` will contain all the output files from the pre-processing phase, mostly are all the initial condition for run the MONAN; - `dataout\Model\` will contain all the output files from the MONAN model; - `dataout\Post\` will contain all the output files from the post-processing phase of the MONAN; - - `dataout\Prods\` will contain all the output files from the products generated, graphics, derivated variables, peace of domain, etc. After running the first step, it will clone the MONAN model from your fork repo in a `source` diretory. diff --git a/VERSION.txt b/VERSION.txt index f0bb29e..88c5fb8 100755 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -1.3.0 +1.4.0 diff --git a/scripts.pomerode/0.run_all_first_time.bash b/scripts.pomerode/0.run_all_first_time.bash deleted file mode 100755 index ea1a1fa..0000000 --- a/scripts.pomerode/0.run_all_first_time.bash +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - - -#if [ $# -ne 5 ] -#then -# echo "" -# echo "Instructions: execute the command below" -# echo "" -# echo "${0} GitHubUserRepo EXP_NAME RESOLUTION LABELI FCST" -# echo "" -# echo "GitHubUserRepo :: GitHub link for your personal fork, eg: https://github.com/MYUSER/MONAN-Model.git" -# echo "EXP_NAME :: Forcing: GFS" -# echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" -# echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" -# echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." -# echo "" -# echo "24 hour forcast example:" -# echo "${0} https://github.com/MYUSER/MONAN-Model.git GFS 1024002 2024010100 24" -# echo "" -# exit -#fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - - -# Input variables:----------------------------------------------------- -github_link="https://github.com/monanadmin/MONAN-Model.git" -monan_branch=release/1.1.0 -convertmpas_branch= -EXP=GFS -RES=1024002 -YYYYMMDDHHi=2024042000 -FCST=240 -#---------------------------------------------------------------------- - - -# STEP 1: Installing and compiling the A-MONAN model and utility programs: -time 1.install_monan.bash ${github_link} ${monan_branch} - -# STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -time 2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - -# STEP 3: Executing the Model run: -time 3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - -# STEP 4: Executing the Post of Model run: -time 4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - -exit diff --git a/scripts.pomerode/1.install_monan.bash b/scripts.pomerode/1.install_monan.bash deleted file mode 100755 index 8e542bf..0000000 --- a/scripts.pomerode/1.install_monan.bash +++ /dev/null @@ -1,292 +0,0 @@ -#!/bin/bash - -#-----------------------------------------------------------------------------# -# !SCRIPT: install_monan -# -# !DESCRIPTION: -# Script to install the MONAN model and convert_MPAS. -# -# Performs the following tasks: -# -# o Clone the Monan model github repository in a local directory -# o Make the script make-all.sh that compiles the Atmosphere Model and the Init Atmosphere Model -# o As alternative for advanced users, this script creates a simple compile script that just compile the Atmosphere Model -# o Clone the Convert_mpas tool from the monanadmin repository for convert the output model files in lat-lon grid. -# o Compile the convert_mpas -# -#-----------------------------------------------------------------------------# - -#Fixed parameters ------------------------------------------------------------# -github_link_CONVERT_MPAS="https://github.com/monanadmin/convert_mpas.git" -#-----------------------------------------------------------------------------# - -#Functions -------------------------------------------------------------------# -function checkout_system() { - local source_dir=$1 - local github_link=$2 - local tag_or_branch_name=$3 - if [ -d "${source_dir}" ]; then - echo -e "${GREEN}==>${NC} Source dir already exists, updating it ...\n" - else - echo -e "${GREEN}==>${NC} Cloning your fork repository...\n" - git clone ${github_link} ${source_dir} - if [ ! -d "${source_dir}" ]; then - echo -e "${RED}==>${NC} An error occurred while cloning your fork. Possible causes: wrong URL, user or password.\n" - exit -1 - fi - fi - - cd ${source_dir} - if git checkout "${tag_or_branch_name}" 2>/dev/null; then - git pull - echo -e "${GREEN}==>${NC} Successfully checked out and updated: ${BLUE}${tag_or_branch_name}" - else - echo -e "${RED}==>${NC} Failed to check out branch: ${BLUE}${tag_or_branch_name}" - echo -e "${RED}==>${NC} Please check if you have this branch. Exiting ..." - exit -1 - fi - git log -1 --name-only -} -#-----------------------------------------------------------------------------# - - -if [ $# -lt 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} [G] [M] [C]" - echo "" - echo "G :: MONAN GitHub link of your personal fork, eg: https://github.com/MYUSER/MONAN-Model.git" - echo "M :: MONAN tag or branch name of your personal fork. (will be used 'develop' if not informed)" - echo "C :: Convert_MPAS tag from ${github_link_CONVERT_MPAS} (will be used 'develop' if not informed)" - echo "" - exit -fi - - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -DATAOUTCRON=${DATAOUT}/cron; mkdir -p ${DATAOUTCRON} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:----------------------------------------------------- -github_link_MONAN=${1}; #github_link=https://github.com/monanadmin/MONAN-Model.git -tag_or_branch_name_MONAN=${2} -tag_or_branch_name_MONAN=${tag_or_branch_name_MONAN:="1.0.0"} -echo "MONAN branch name in use: ${tag_or_branch_name_MONAN}" - -tag_or_branch_name_CONVERT_MPAS=${3} -tag_or_branch_name_CONVERT_MPAS=${tag_or_branch_name_CONVERT_MPAS:="1.0.0"} -echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" -#---------------------------------------------------------------------- - - -# Local variables:----------------------------------------------------- -MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} -CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} -$(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) -#---------------------------------------------------------------------- - -checkout_system ${MONANDIR} ${github_link_MONAN} ${tag_or_branch_name_MONAN} -checkout_system ${CONVERT_MPAS_DIR} ${github_link_CONVERT_MPAS} ${tag_or_branch_name_CONVERT_MPAS} - -rm -rf $MONANDIR/default_inputs/ -rm -f $MONANDIR/stream_list.* $MONANDIR/streams.* $MONANDIR/namelist.* -rm -f $MONANDIR/make*.output.atmosphere $MONANDIR/make*.output.init_atmosphere $MONANDIR/make.sh $MONANDIR/make-all.sh - - -#CR: TODO: maybe later move this make script to main scripts directory. -echo "" -echo -e "${GREEN}==>${NC} Making compile script...\n" - -cd $MONANDIR - -cat << EOF > make-all.sh -#!/bin/bash -#Usage: make target CORE=[core] [options] -#Example targets: -# ifort -# gfortran -# xlf -# pgi -#Availabe Cores: -# atmosphere -# init_atmosphere -# landice -# ocean -# seaice -# sw -# test -#Available Options: -# DEBUG=true - builds debug version. Default is optimized version. -# USE_PAPI=true - builds version using PAPI for timers. Default is off. -# TAU=true - builds version using TAU hooks for profiling. Default is off. -# AUTOCLEAN=true - forces a clean of infrastructure prior to build new core. -# GEN_F90=true - Generates intermediate .f90 files through CPP, and builds with them. -# TIMER_LIB=opt - Selects the timer library interface to be used for profiling the model. Options are: -# TIMER_LIB=native - Uses native built-in timers in MPAS -# TIMER_LIB=gptl - Uses gptl for the timer interface instead of the native interface -# TIMER_LIB=tau - Uses TAU for the timer interface instead of the native interface -# OPENMP=true - builds and links with OpenMP flags. Default is to not use OpenMP. -# OPENACC=true - builds and links with OpenACC flags. Default is to not use OpenACC. -# USE_PIO2=true - links with the PIO 2 library. Default is to use the PIO 1.x library. -# PRECISION=single - builds with default single-precision real kind. Default is to use double-precision. -# SHAREDLIB=true - generate position-independent code suitable for use in a shared library. Default is false. - - -. ${SCRIPTS}/setenv.bash -rm -fr ${MONANDIR}/stream* ${MONANDIR}/namelist.* ${MONANDIR}/make_*output.atmosphere ${MONANDIR}/default_inputs -DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") - -sed -i "s/DMPAS_USE_MPI_F08/DMPAS_USE_MPI_H/" ${MONANDIR}/Makefile -sed -i "s,framework.*$,framework -I../../../../external/esmf_time_f90," ${MONANDIR}/src/core_atmosphere/physics/physics_noahmp/src/Makefile - -echo "NETCDF: $NETCDF" -echo "NETCDFF: $NETCDFF" -echo "PNETCDF: $PNETCDF" -echo "HDF5: $HDF5" -echo "PIO: $PIO" -echo "" -echo "" -echo "" - -MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" -make clean CORE=atmosphere -make -j 8 nvhpc CORE=atmosphere USE_PIO=true OPENACC=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -#CR: TODO: put verify here if executable was created ok -mv ${MONANDIR}/atmosphere_model ${EXECS} -mv ${MONANDIR}/build_tables ${EXECS} -cp ${MONANDIR}/VERSION.txt ${EXECS} -cp ${MONANDIR}/GF_ConvPar_nml ${SCRIPTS} -make clean CORE=atmosphere - -MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" -make clean CORE=init_atmosphere -make -j 8 nvhpc CORE=init_atmosphere USE_PIO=true OPENACC=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -mv ${MONANDIR}/init_atmosphere_model ${EXECS} -make clean CORE=init_atmosphere - - -if [ -s "${EXECS}/init_atmosphere_model" ] && [ -e "${EXECS}/atmosphere_model" ]; then - echo "" - echo -e "${GREEN}==>${NC} Files init_atmosphere_model and atmosphere_model generated Successfully in ${EXECS} !" - echo -else - echo -e "${RED}==>${NC} !!! An error occurred during build. Check output" - exit -1 -fi - -EOF -chmod a+x make-all.sh - - -cat << EOF > make.sh -#!/bin/bash -#Usage: make target CORE=[core] [options] -#Example targets: -# ifort -# gfortran -# xlf -# pgi -#Availabe Cores: -# atmosphere -# init_atmosphere -# landice -# ocean -# seaice -# sw -# test -#Available Options: -# DEBUG=true - builds debug version. Default is optimized version. -# USE_PAPI=true - builds version using PAPI for timers. Default is off. -# TAU=true - builds version using TAU hooks for profiling. Default is off. -# AUTOCLEAN=true - forces a clean of infrastructure prior to build new core. -# GEN_F90=true - Generates intermediate .f90 files through CPP, and builds with them. -# TIMER_LIB=opt - Selects the timer library interface to be used for profiling the model. Options are: -# TIMER_LIB=native - Uses native built-in timers in MPAS -# TIMER_LIB=gptl - Uses gptl for the timer interface instead of the native interface -# TIMER_LIB=tau - Uses TAU for the timer interface instead of the native interface -# OPENMP=true - builds and links with OpenMP flags. Default is to not use OpenMP. -# OPENACC=true - builds and links with OpenACC flags. Default is to not use OpenACC. -# USE_PIO2=true - links with the PIO 2 library. Default is to use the PIO 1.x library. -# PRECISION=single - builds with default single-precision real kind. Default is to use double-precision. -# SHAREDLIB=true - generate position-independent code suitable for use in a shared library. Default is false. - -. ${SCRIPTS}/setenv.bash -rm -fr ${MONANDIR}/stream* ${MONANDIR}/namelist.* ${MONANDIR}/make_*output.atmosphere ${MONANDIR}/default_inputs -DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") - -sed -i "s/DMPAS_USE_MPI_F08/DMPAS_USE_MPI_H/" ${MONANDIR}/Makefile -sed -i "s,framework.*$,framework -I../../../../external/esmf_time_f90," ${MONANDIR}/src/core_atmosphere/physics/physics_noahmp/src/Makefile - -MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" -make clean CORE=atmosphere -make -j 8 nvhpc CORE=atmosphere USE_PIO=true OPENACC=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -#CR: TODO: put verify here if executable was created ok -mv ${MONANDIR}/atmosphere_model ${EXECS} -mv ${MONANDIR}/build_tables ${EXECS} -make clean CORE=atmosphere - -if [ -e "${EXECS}/atmosphere_model" ]; then - echo "" - echo -e "${GREEN}==>${NC} Files init_atmosphere_model and atmosphere_model generated Successfully in ${EXECS} !" - echo -else - echo -e "${RED}==>${NC} !!! An error occurred during build. Check output" - exit -1 -fi - -EOF -chmod a+x make.sh - - -echo "" -echo -e "${GREEN}==>${NC} Installing init_atmosphere_model and atmosphere_model...\n" -echo "" - -#CR: TODO: maybe at this point we should put our registry-file et all. -#CR: make-all.sh compile all for the first time -#CR: make.sh just compile the A-model -. ${MONANDIR}/make-all.sh - - -# install convert_mpas -echo "" -echo -e "${GREEN}==>${NC} Moduling environment for convert_mpas...\n" -module load monan_nvhpc-24.9 -module list - -cd ${CONVERT_MPAS_DIR} -echo "" -echo -e "${GREEN}==>${NC} Installing convert_mpas...\n" -make clean -make 2>&1 | tee make.convert.output - -#CR: TODO: put verify here if executable was created ok -mv ${CONVERT_MPAS_DIR}/convert_mpas ${EXECS}/ - -if [ -s "${EXECS}/convert_mpas" ] ; then - echo "" - echo -e "${GREEN}==>${NC} File convert_mpas generated Sucessfully in ${CONVERT_MPAS_DIR} and copied to ${EXECS} !" - echo -else - echo -e "${RED}==>${NC} !!! An error occurred during convert_mpas build. Check output" - exit -1 -fi - diff --git a/scripts.pomerode/2.pre_processing.bash b/scripts.pomerode/2.pre_processing.bash deleted file mode 100755 index 485bed6..0000000 --- a/scripts.pomerode/2.pre_processing.bash +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: pre_processing -# -# !DESCRIPTION: -# Script to prepare boundary and initials conditions for MONAN model. -# -# Performs the following tasks: -# -# o Creates topography, land use and static variables -# o Ungrib GFS data -# o Interpolates to model the grid -# o Creates initial and boundary conditions -# o Creates scripts to run the model and post-processing (CR: to be modified to phase 3 and 4) -# o Integrates the MONAN model ((CR: to be modified to phase 3) -# o Post-processing (netcdf for grib2, latlon regrid, crop) (CR: to be modified to phase 4) -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME/OP RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "OP :: clean: remove all temporary files createed in the last run." - 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)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forecast example for 24km:" - echo "${0} GFS 1024002 2024010100 24" - echo "48 hour forecast example for 120km:" - echo "${0} GFS 40962 2024010100 48" - echo "Cleannig temp files example:" - echo "${0} clean" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -if [ $# -eq 1 ] -then - op=$(echo "${1}" | tr '[A-Z]' '[a-z]') - if [ ${op} = "clean" ] - then - clean_pre_tmp_files - exit - else - echo "Should type just \"clean\" for cleanning." - echo "${0} clean" - echo "" - exit - fi -fi - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -# Calculating CIs and final forecast dates in model namelist format: -yyyymmddi=${YYYYMMDDHHi:0:8} -hhi=${YYYYMMDDHHi:8:2} -yyyymmddhhf=$(date +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${FCST} hours" ) -final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhhf:8:2}.00.00 -#------------------------------------------------------- - - -echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" -git log -1 --name-only -git branch | head -1 - - -# Untar the fixed files: -# x1.${RES}.graph.info.part. files can be found in datain/fixed -# *.TBL files also can be found in datain/fixed -# x1.${RES}.grid.nc also can be found in datain/fixed - -echo -e "${GREEN}==>${NC} copying and linking fixed input data... \n" -mkdir -p ${DATAIN} -rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - -# 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} -else - echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n" -fi -#---------------------------------------------------------------------------------- - - - -# Degrib phase:--------------------------------------------------------------------- -echo -e "${GREEN}==>${NC} Submiting Degrib...\n" -time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#---------------------------------------------------------------------------------- - - - -# Init Atmosphere phase:------------------------------------------------------------ -echo -e "${GREEN}==>${NC} Submiting Init Atmosphere...\n" -time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#---------------------------------------------------------------------------------- - - - - diff --git a/scripts.pomerode/3.run_model.bash b/scripts.pomerode/3.run_model.bash deleted file mode 100755 index 9b2b9e0..0000000 --- a/scripts.pomerode/3.run_model.bash +++ /dev/null @@ -1,248 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: run_model -# -# !DESCRIPTION: -# Script to run the MONAN model over the forecast horizon. -# -# Performs the following tasks: -# -# o VCheck all input files before -# o Creates the submition script -# o Submit the model -# o Veriffy all files generated -# -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} [EXP_NAME/OP] RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "OP :: clean: remove all temporary files createed in the last run." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forecast example for 24km:" - echo "${0} GFS 1024002 2024010100 24" - echo "48 hour forecast example for 120km:" - echo "${0} GFS 40962 2024010100 48" - echo "Cleannig temp files example:" - echo "${0} clean" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -if [ $# -eq 1 ] -then - op=$(echo "${1}" | tr '[A-Z]' '[a-z]') - if [ ${op} = "clean" ] - then - clean_model_tmp_files - exit - else - echo "Should type just \"clean\" for cleanning." - echo "${0} clean" - echo "" - exit - fi -fi - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=6 -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -cores=${MODEL_ncores} -hhi=${YYYYMMDDHHi:8:2} -NLEV=55 -CONFIG_CONV_INTERVAL="00:30:00" - -# Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - CONFIG_DT=150.0 - CONFIG_LEN_DISP=24000.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 2621442 ]; then #15Km - CONFIG_DT=90.0 - CONFIG_LEN_DISP=15000.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 40962 ]; then #120Km - CONFIG_DT=600.0 - CONFIG_LEN_DISP=120000.0 -fi -#------------------------------------------------------- - - -# Calculating final forecast dates in model namelist format: DD_HH:MM:SS -# using: start_date(yyyymmdd) + FCST(hh) : -ind=$(printf "%02d\n" $(echo "${FCST}/24" | bc)) -inh=$(printf "%02.0f\n" $(echo "((${FCST}/24)-${ind})*24" | bc -l)) -DD_HHMMSS_forecast=$(echo "${ind}_${inh}:00:00") - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - -clean_model_tmp_files - -files_needed=("${DATAIN}/namelists/stream_list.atmosphere.output" ""${DATAIN}/namelists/stream_list.atmosphere.diagnostics "${DATAIN}/namelists/stream_list.atmosphere.surface" "${EXECS}/atmosphere_model" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${DATAIN}/fixed/Vtable.GFS") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -ln -sf ${EXECS}/atmosphere_model ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*TBL ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*DBL ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*DATA ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.static.nc ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${SCRIPTS} -ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${SCRIPTS} -ln -sf ${DATAIN}/fixed/Vtable.GFS ${SCRIPTS} - - -if [ ${EXP} = "GFS" ] -then - sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; -s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g" \ - ${DATAIN}/namelists/namelist.atmosphere.TEMPLATE > ${SCRIPTS}/namelist.atmosphere - - sed -e "s,#RES#,${RES},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ - ${DATAIN}/namelists/streams.atmosphere.TEMPLATE > ${SCRIPTS}/streams.atmosphere -fi -cp -f ${DATAIN}/namelists/stream_list.atmosphere.output ${SCRIPTS} -cp -f ${DATAIN}/namelists/stream_list.atmosphere.diagnostics ${SCRIPTS} -cp -f ${DATAIN}/namelists/stream_list.atmosphere.surface ${SCRIPTS} - - - -rm -f ${SCRIPTS}/model.bash -cat << EOF0 > ${SCRIPTS}/model.bash -#!/bin/bash -#SBATCH --job-name=${MODEL_jobname} -#SBATCH --nodes=${MODEL_nnodes} -#SBATCH --ntasks=${MODEL_ncores} -#SBATCH --tasks-per-node=${MODEL_ncpn} -#SBATCH --partition=${MODEL_QUEUE} -#SBATCH --gres=${MODEL_gres} -#SBATCH --time=${MODEL_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e%j # File name for standard error output -#SBATCH --exclusive -##SBATCH --mem=500000 - -export executable=atmosphere_model - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} -date - -# -# move dataout, clean up and remove files/links -# - -mv MONAN_DIAG_* ${DATAOUT}/${YYYYMMDDHHi}/Model -mv MONAN_HIST_* ${DATAOUT}/${YYYYMMDDHHi}/Model -cp ${EXECS}/VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model - -mv log.atmosphere.*.out ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv log.atmosphere.*.err ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv namelist.atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv stream* ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - -rm -f ${SCRIPTS}/atmosphere_model -rm -f ${SCRIPTS}/*TBL -rm -f ${SCRIPTS}/*.DBL -rm -f ${SCRIPTS}/*DATA -rm -f ${SCRIPTS}/x1.${RES}.static.nc -rm -f ${SCRIPTS}/x1.${RES}.graph.info.part.${cores} -rm -f ${SCRIPTS}/Vtable.GFS -rm -f ${SCRIPTS}/x1.${RES}.init.nc - - - -EOF0 -chmod a+x ${SCRIPTS}/model.bash - - -echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" -echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/logs... \n" -echo -e "sbatch ${SCRIPTS}/model.bash" -sbatch --wait ${SCRIPTS}/model.bash -mv ${SCRIPTS}/model.bash ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - - -output_interval=3 -for i in $(seq 0 ${output_interval} ${FCST}) -do - hh=${YYYYMMDDHHi:8:2} - currentdate=$(date -u +"%Y%m%d%H" -d "${YYYYMMDDHHi:0:8} ${hh}:00 ${i} hours") - file=MONAN_DIAG_G_MOD_GFS_${YYYYMMDDHHi}_${currentdate}.00.00.x${RES}L55.nc - - if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} was not generated. \n" - exit -1 - fi - -done - - diff --git a/scripts.pomerode/4.run_post.bash b/scripts.pomerode/4.run_post.bash deleted file mode 100755 index 63b40d0..0000000 --- a/scripts.pomerode/4.run_post.bash +++ /dev/null @@ -1,306 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: run_post -# -# !DESCRIPTION: -# Script to run the pos-processing of MONAN model over the forecast horizon. -# -# Performs the following tasks: -# -# o VCheck all input files before -# o Creates the submition script -# o Submit the post -# o Veriffy all files generated -# -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} ]EXP_NAME/OP] RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "OP :: clean: remove all temporary files createed in the last run." - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "${0} GFS 40962 2024010100 48" - echo "Cleannig temp files example:" - echo "${0} clean" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -if [ $# -eq 1 ] -then - op=$(echo "${1}" | tr '[A-Z]' '[a-z]') - if [ ${op} = "clean" ] - then - clean_post_tmp_files - exit - else - echo "Should type just \"clean\" for cleanning." - echo "${0} clean" - echo "" - exit - fi -fi - - - -# Standart directories variables:--------------------------------------- -DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} -DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} -export SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024042000 -FCST=${4}; #FCST=40 -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Post/logs - - -# Local variables-------------------------------------- -START_DATE_YYYYMMDD="${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}" -START_HH="${YYYYMMDDHHi:8:2}" -maxpostpernode=20 # <------ qtde max de convert_mpas por no! -#------------------------------------------------------- - -# Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - NLAT=720 #180/0.25 - NLON=1440 #360/0.25 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 2621442 ]; then #15Km - NLAT=1200 #180/0.15 - NLON=2400 #360/0.15 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 40962 ]; then #120Km - #CR-TODO: verificar se precisa corrigir para esta resolucao tambem: - NLAT=181 - NLON=361 - STARTLAT=-90.5 - STARTLON=-0.5 - ENDLAT=90.5 - ENDLON=360.5 -fi -#------------------------------------------------------- - -clean_post_tmp_files - -files_needed=("${DATAIN}/namelists/include_fields.diag" "${DATAIN}/namelists/convert_mpas.nml" "${DATAIN}/namelists/target_domain.TEMPLATE" "${EXECS}/convert_mpas" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -# Captura quantos arquivos do modelo tiverem para serem pos-processados e -# quando nos serao necessarios para executar ${maxpostpernode} convert_mpas por no: -#nfiles=$(ls -l ${DATAOUT}/${YYYYMMDDHHi}/Model/MONAN*nc | wc -l) -# from streams.atmosphere.TEMPLATE in diagnostics the output_interval is 3 hours -output_interval=3 -#nfiles=FCST/output_interval + 1(time zero file) -nfiles=$(echo "$FCST/$output_interval + 1" | bc) -echo "${nfiles} post to submit." -echo "Max ${maxpostpernode} submits per nodes." -how_many_nodes ${nfiles} ${maxpostpernode} - -# Cria os diretorios e arquivos/links para cada saida do convert_mpas: -cd ${SCRIPTS} -for ii in $(seq 1 ${nfiles}) -do - i=$(printf "%03d" ${ii}) - mkdir -p ${SCRIPTS}/dir.${i} - - ln -sf ${DATAIN}/namelists/include_fields.diag ${SCRIPTS}/dir.${i}/include_fields.diag - ln -sf ${DATAIN}/namelists/convert_mpas.nml ${SCRIPTS}/dir.${i}/convert_mpas.nml - sed -e "s,#NLAT#,${NLAT},g;s,#NLON#,${NLON},g;s,#STARTLAT#,${STARTLAT},g;s,#ENDLAT#,${ENDLAT},g;s,#STARTLON#,${STARTLON},g;s,#ENDLON#,${ENDLON},g;" \ - ${DATAIN}/namelists/target_domain.TEMPLATE > ${SCRIPTS}/dir.${i}/target_domain - - rm -rf ${SCRIPTS}/dir.${i}/convert_mpas - ln -sf ${EXECS}/convert_mpas ${SCRIPTS}/dir.${i} - ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${SCRIPTS}/dir.${i} - - hh=${YYYYMMDDHHi:8:2} - currentdate=$(date -d "${YYYYMMDDHHi:0:8} ${hh}:00 $(echo "(${i}-1)*3" | bc) hours" +"%Y%m%d%H") - diag_name=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_${currentdate}.00.00.x${RES}L55.nc - #CR-TODO: verificar se o arq existe antes de fazer o link: - ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Model/${diag_name} ${SCRIPTS}/dir.${i} -done - -cd ${SCRIPTS} -. ${SCRIPTS}/setenv_python.bash - -# Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: -node=1 -inicio=1 -fim=$((maxpostpernode <= nfiles ? maxpostpernode : nfiles)) -while [ ${inicio} -le ${nfiles} ] -do -cat > ${SCRIPTS}/PostAtmos_node.${node}.sh < convert_mpas.output & - echo "./convert_mpas x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Model/\${diag_name} > convert_mpas.output" - -done - -# necessario aguardar as rodadas em background -wait - -for ii in \$(seq ${inicio} ${fim}) -do - i=\$(printf "%03d" \${ii}) - cd ${SCRIPTS}/dir.\${i} - python ${SCRIPTS}/group_levels.py ${SCRIPTS}/dir.\${i} latlon.nc latlon_\${i}.nc > saida_python.txt & -done - -wait - -# unload the python's environment -deactivate - -for ii in \$(seq ${inicio} ${fim}) -do - i=\$(printf "%03d" \${ii}) - cd ${SCRIPTS}/dir.\${i} - rm -f ${DATAOUT}/${YYYYMMDDHHi}/Post/latlon_\${i}.nc - cp -f latlon_\${i}.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/ & -done -wait - -EOSH - - chmod a+x ${SCRIPTS}/PostAtmos_node.${node}.sh - jobid[${node}]=$(sbatch --parsable ${SCRIPTS}/PostAtmos_node.${node}.sh) - echo "JobId node ${node} = ${jobid[${node}]} , convert_mpas ${inicio} to ${fim}" - - inicio=$((fim + 1)) - temp=$((fim + maxpostpernode)) - fim=$(( temp < nfiles ? temp : nfiles )) - node=$((node+1)) -done - -# Dependencias JobId: -dependency="afterok" -for job_id in "${jobid[@]}" -do - dependency="${dependency}:${job_id}" -done - - - - - -# Script principal para juntar os arquivos finais em um unico: -node=0 -cat > ${SCRIPTS}/PostAtmos_node.${node}.sh <\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=6 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -yyyymmddi=${YYYYMMDDHHi:0:8} -hhi=${YYYYMMDDHHi:8:2} -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Prods/logs - - -#for nh in $(seq 1 ${FCST}) -#do - nh=2 - yyyymmddhhf=$(date -u +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${nh} hours" ) - yyyymmddhhff=$(date -u +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 $((nh+1)) hours" ) - -rm -f ${DATAOUT}/${YYYYMMDDHHi}/Prods/MONAN_PREC_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhff}.00.00.x${RES}L55.png -rm -f ${SCRIPTS}/prec.gs -cat << EOGS > ${SCRIPTS}/prec.gs -'reinit' -'set display color white' -'c' -'set gxout shaded' - -'sdfopen ${DATAOUT}/${YYYYMMDDHHi}/Post/MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhf}.00.00.x${RES}L55.nc' -'sdfopen ${DATAOUT}/${YYYYMMDDHHi}/Post/MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhff}.00.00.x${RES}L55.nc' -'set mpdset mres' -'set grads off' - -'set lon 276.25 339.5' -'set lat -55.75 14.25' - -'pr1=rainc.1+rainnc.1' -'pr25=rainc.2(t=1)+rainnc.2(t=1)' - -'set clevs 0.5 1 2 4 8 16 32 64 128' -'set ccols 0 14 11 5 13 10 7 12 2 6' - -'d pr25-pr1' -'set gxout contour' - -'cbar' -'draw title Previsao de Precipitacao \ MONAN: prod: 2024010100 valid: 2024010102' - -'set strsiz 0.15 0.15' -'draw string 7.8 0.3 (mm)' -'set strsiz 0.10 0.10' -'set string 1 l 5' -'draw string 0.1 0.1 MONAN v.0.4.0' - - -'printim ${DATAOUT}/${YYYYMMDDHHi}/Prods/MONAN_PREC_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhff}.00.00.x${RES}L55.png' -'quit' - - - -EOGS - - -cat << EOF0 > ${SCRIPTS}/prods.bash -#!/bin/bash -#SBATCH --job-name=${PRODS_jobname} -#SBATCH --nodes=${PRODS_nnodes} -#SBATCH --ntasks=${PRODS_ncores} -#SBATCH --tasks-per-node=${PRODS_ncpn} -#SBATCH --partition=${PRODS_QUEUE} -#SBATCH --time=${PRODS_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Prods/logs/prods.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Prods/logs/prods.bash.e%j # File name for standard error output -##SBATCH --exclusive -##SBATCH --mem=500000 - - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - -date -time grads -bpcx "run prec.gs" -date - - -EOF0 -chmod a+x ${SCRIPTS}/prods.bash - - -echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model Products and waiting for finish before exit... \n" -echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/${YYYYMMDDHHi}/Prods/logs... \n" -echo -e "sbatch ${SCRIPTS}/prods.bash" -sbatch --wait ${SCRIPTS}/prods.bash -rm -f ${SCRIPTS}/prods.bash diff --git a/scripts.pomerode/6.do_manut.bash b/scripts.pomerode/6.do_manut.bash deleted file mode 100755 index 74fd325..0000000 --- a/scripts.pomerode/6.do_manut.bash +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: do_manut -# -# !DESCRIPTION: -# Script that maintains the MONAN model suite healthy. -# -# Performs the following tasks: -# -# o Feeds public areas (FTP) with important files (figures, outputs, -# clippings, etc.) -# o Removes temporary files with no value that are eventually generated -# during integration. -# o Performs maintenance on the area occupied by the model, moving old -# outputs to their destination area. -# -# -#-----------------------------------------------------------------------------# - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart directories variables:---------------------- -DIRHOME=${DIRWORK}/../../MONAN; mkdir -p ${DIRHOME} -SCRIPTS=${DIRHOME}/scripts; mkdir -p ${SCRIPTS} -DATAIN=${DIRHOME}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOME}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOME}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOME}/execs; mkdir -p ${EXECS} -#------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- -cp -f setenv.bash ${SCRIPTS} - - -# Local variables-------------------------------------- -#------------------------------------------------------- - - -# TODO compress all output files - -# +cat > Compress_exe.sh <> ${LOG_FILE} 2>&1 -# +tar -cf - diagnostics_${START_DATE_YYYYMMDD}.nc | xz -9 -c - > diagnostics_${START_DATE_YYYYMMDD}.tar.xz -# + -# +#echo -e "Compressing all /monanprd/diag*.nc files...\n" >> ${LOG_FILE} 2>&1 -# +#tar -cf - ${EXPDIR}/monanprd | xz -9 -c - > monanprd_${START_DATE_YYYYMMDD}.tar.xz -# + -# +exit 0 -# +EOF0 -# + -# +chmod +x Compress_exe.sh - - diff --git a/scripts.pomerode/group_levels.py b/scripts.pomerode/group_levels.py deleted file mode 100755 index 6acb4f1..0000000 --- a/scripts.pomerode/group_levels.py +++ /dev/null @@ -1,107 +0,0 @@ - -import netCDF4 as nc -import numpy as np -import re -import sys - - -def main(data_dir, file_in, file_out, levels=[1000, 975, 950, 925, 900, 875, 850, 825, 700, 600, 500, 400, \ - 300, 250, 200, 150, 100, 70, 50, 30, 20, 15]): - """ - This function takes in the data directory, input file name, and output file name. - It reads the input NetCDF file, groups variables based on their names, - creates a new NetCDF file with dimensions and variables copied from the input file, - and saves the concatenated variables to the new NetCDF file. - - Parameters: - data_dir (str): The directory where the input and output NetCDF files are located. - file_in (str): The name of the input NetCDF file. - file_out (str): The name of the output NetCDF file. - - Returns: - None - """ - - nc_file_in = nc.Dataset(f'{data_dir}/{file_in}', 'r') - # Save the concatenated variables to a new NetCDF file - nc_file_out = nc.Dataset(f'{data_dir}/{file_out}', 'w') - - dimensions_4D = ('time', 'level', 'latitude', 'longitude') - # Group variables based on their names - variable_groups = {} - first_hpa_variable = '' - for name, variable in reversed(list(nc_file_in.variables.items())): # reverse to be consistent to levels - # if 'hPa' in name or name in dimensions_4D: - if 'hPa' in name: - variable_type = re.split('_.\d*hPa', name)[0] # Extract the variable type (e.g., '15hPa', '20hPa') - first_hpa_variable = variable_type if first_hpa_variable == '' else first_hpa_variable - else: - variable_type = name.lower() - if variable_type not in variable_groups: - variable_groups[variable_type] = [variable] - else: - variable_groups[variable_type].append(variable) - - level_dimension_size = len(variable_groups[first_hpa_variable]) - - # Copy dimensions Time, latitude, longitude - for dim_name, dim_type in nc_file_in.dimensions.items(): - if dim_name.lower() in ['time', 'latitude', 'longitude']: - nc_file_out.createDimension(dim_name.lower(), dim_type.size) - nc_file_out.createDimension('level', level_dimension_size) - - - # Copy variables - for variable_type, variables in variable_groups.items(): - print(f'Creating var {variable_type}') - if variable_type == 'level': - new_variable = nc_file_out.createVariable(variable_type, variables[0].dtype, (variable_type) ) - new_variable.setncatts({k: variables[0].getncattr(k) for k in variables[0].ncattrs()}) - new_variable[:] = range(level_dimension_size, 0, -1) if levels is None else levels - new_variable.setncattr('positive', "down") - new_variable.setncattr('units', "hPa") - # if its variables with on isobaric level per variable - elif len(variables) == level_dimension_size: - new_variable = nc_file_out.createVariable(variable_type, variables[0].dtype, dimensions_4D) - new_variable.setncatts({k: variables[0].getncattr(k) for k in variables[0].ncattrs()}) - if 'vertically interpolated' in new_variable.getncattr('long_name'): - new_long_name = new_variable.getncattr('long_name').split('vertically interpolated')[0].strip() - elif 'interpolated' in new_variable.getncattr('long_name'): - new_long_name = new_variable.getncattr('long_name').split('interpolated')[0].strip() - elif '1000 hPa' in new_variable.getncattr('long_name'): - new_long_name = new_variable.getncattr('long_name').split('1000 hPa')[0].strip() - else: - new_long_name = new_variable.getncattr('long_name') - new_long_name += ' interpolated' - new_variable.setncattr('long_name', new_long_name) - - for i in range(level_dimension_size): - new_variable[:,i,:,:] = variables[i][:] - else: - # Create an empty list to store lowercase dimensions - lowercase_dimensions = [] - - # Iterate through each object in the tuple - for obj in variables[0].dimensions: - # Access the 'dimensions' attribute and convert to lowercase - lowercase_dimensions.append(obj.lower()) - # Convert the list of lowercase dimensions to a tuple - - lowercase_dimensions_tuple = tuple(lowercase_dimensions) - # variable_type in ('latitude', 'longitude', 'Time'): - new_variable = nc_file_out.createVariable(variable_type, variables[0].dtype, lowercase_dimensions_tuple) - new_variable.setncatts({k: variables[0].getncattr(k) for k in variables[0].ncattrs()}) - new_variable[:] = variables[0][:] - - nc_file_out.close() - nc_file_in.close() - - -if __name__ == "__main__": - import sys - - if len(sys.argv) != 4: - print(f"Usage: python {sys.argv[0]} ") - sys.exit(1) - - main(sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/scripts.pomerode/link_grib.csh b/scripts.pomerode/link_grib.csh deleted file mode 100755 index e087015..0000000 --- a/scripts.pomerode/link_grib.csh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/csh -f - -set alpha = ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) -set i1 = 1 -set i2 = 1 -set i3 = 1 - -if ( ( ${#argv} == 1 ) || ( ( ${#argv} == 2 ) && ( ${2} == "." ) ) ) then - - rm -f GRIBFILE.??? >& /dev/null - - foreach f ( ${1}* ) - - ln -sf ${f} GRIBFILE.$alpha[$i3]$alpha[$i2]$alpha[$i1] - @ i1 ++ - - if ( $i1 > 26 ) then - set i1 = 1 - @ i2 ++ - if ( $i2 > 26 ) then - set i2 = 1 - @ i3 ++ - if ( $i3 > 26 ) then - echo "RAN OUT OF GRIB FILE SUFFIXES!" - endif - endif - endif - - end -else if ( ${#argv} > 1 ) then - - rm -f GRIBFILE.??? >& /dev/null - - foreach f ( $* ) - - if ( $f != "." ) then - ln -sf ${f} GRIBFILE.$alpha[$i3]$alpha[$i2]$alpha[$i1] - @ i1 ++ - - if ( $i1 > 26 ) then - set i1 = 1 - @ i2 ++ - if ( $i2 > 26 ) then - set i2 = 1 - @ i3 ++ - if ( $i3 > 26 ) then - echo "RAN OUT OF GRIB FILE SUFFIXES!" - endif - endif - endif - endif - - end -else if ( ${#argv} == 0 ) then - echo " " - echo " " - echo " Please provide some GRIB data to link" - echo " usage: $0 path_to_grib_data/grib_data_root" - echo " " - echo " " -endif - diff --git a/scripts.pomerode/make_degrib.bash b/scripts.pomerode/make_degrib.bash deleted file mode 100755 index 1aba077..0000000 --- a/scripts.pomerode/make_degrib.bash +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "${0} GFS 40962 2024010100 48" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -OPERDIREXP=${OPERDIR}/${EXP} -BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} -GCCCIS=/dados/monan/MONAN_datain/CIs/${EXP} -#------------------------------------------------------- -mkdir -p ${DATAIN}/${YYYYMMDDHHi} -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - -#mkdir -p ${HOME}/local/lib64 -#cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 -#cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 - - -# Se nao existir CI no diretorio do IO, -# busca no nosso dir /dados/monan/MONAN_datain/CIs, se nao existir tbm, aborta! -if [ ! -s ${BNDDIR}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -then - if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] - then - echo -e "${RED}==>${NC}Condicao de contorno inexistente !" - echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}" - exit 1 - else - BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} - fi -fi - -files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${BNDDIR}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -ln -sf ${DATAIN}/fixed/x1.${RES}.static.nc ${SCRIPTS} -ln -sf ${DATAIN}/fixed/Vtable.${EXP} ${SCRIPTS}/Vtable -ln -sf ${EXECS}/ungrib.exe ${SCRIPTS} -cp -rf ${BNDDIR}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} - - - - -rm -f ${SCRIPTS}/degrib.bash -cat << EOF0 > ${SCRIPTS}/degrib.bash -#!/bin/bash -#SBATCH --job-name=${DEGRIB_jobname} -#SBATCH --nodes=${DEGRIB_nnodes} -#SBATCH --partition=${DEGRIB_QUEUE} -#SBATCH --gres=${DEGRIB_gres} -#SBATCH --ntasks=${DEGRIB_ncores} -#SBATCH --tasks-per-node=${DEGRIB_ncpn} # ic for benchmark -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/debrib.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/debrib.e%j # File name for standard error output -# - -ulimit -s unlimited -ulimit -c unlimited -ulimit -v unlimited - -export PMIX_MCA_gds=hash - -#export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 -#ldd ungrib.exe - -cd ${SCRIPTS} -. setenv.bash - - -rm -f GRIBFILE.* namelist.wps - - -sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ - ${DATAIN}/namelists/namelist.wps.TEMPLATE > ./namelist.wps - -./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 - - -date -time mpirun -np 1 ungrib.exe -date - - -grep "Successful completion of program ungrib.exe" ${SCRIPTS}/ungrib.log >& /dev/null - -if [ \$? -ne 0 ]; then - echo " BUMMER: Ungrib generation failed for some yet unknown reason." - echo " " - tail -10 ${SCRIPTS}/ungrib.log - echo " " - exit 21 -fi - -# -# clean up and remove links -# - mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log - mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps - mv GFS\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre - - rm -f ${SCRIPTS}/ungrib.exe - rm -f ${SCRIPTS}/Vtable - rm -f ${SCRIPTS}/x1.${RES}.static.nc - rm -f ${SCRIPTS}/GRIBFILE.AAA - rm -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 - - -echo "End of degrib Job" - - -EOF0 -chmod a+x ${SCRIPTS}/degrib.bash - -echo -e "${GREEN}==>${NC} Executing sbatch degrib.bash...\n" -cd ${SCRIPTS} -sbatch --wait ${SCRIPTS}/degrib.bash -mv ${SCRIPTS}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - - - -files_ungrib=("${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}") -for file in "${files_ungrib[@]}" -do - if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${file} ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} Degrib fails! At least the file ${file} was not generated at ${DATAIN}/${YYYYMMDDHHi}. \n" - echo -e "${RED}==>${NC} Check logs at ${DATAOUT}/logs/debrib.* .\n" - echo -e "${RED}==>${NC} Exiting script. \n" - exit -1 - fi -done - diff --git a/scripts.pomerode/make_initatmos.bash b/scripts.pomerode/make_initatmos.bash deleted file mode 100755 index 309eb1d..0000000 --- a/scripts.pomerode/make_initatmos.bash +++ /dev/null @@ -1,160 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -GEODATA=${DATAIN}/WPS_GEOG -cores=${INITATMOS_ncores} -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - cd ${DATAIN}/fixed - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - - -files_needed=("${DATAIN}/namelists/namelist.init_atmosphere.TEMPLATE" "${DATAIN}/namelists/streams.init_atmosphere.TEMPLATE" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${start_date:0:13}" "${EXECS}/init_atmosphere_model") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - - -sed -e "s,#LABELI#,${start_date},g;s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ - ${DATAIN}/namelists/namelist.init_atmosphere.TEMPLATE > ${SCRIPTS}/namelist.init_atmosphere - -sed -e "s,#RES#,${RES},g" \ - ${DATAIN}/namelists/streams.init_atmosphere.TEMPLATE > ${SCRIPTS}/streams.init_atmosphere - - -ln -sf ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.static.nc ${SCRIPTS} -ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}\:${start_date:0:13} ${SCRIPTS} -ln -sf ${EXECS}/init_atmosphere_model ${SCRIPTS} - - -rm -f ${SCRIPTS}/initatmos.bash -cat << EOF0 > ${SCRIPTS}/initatmos.bash -#!/bin/bash -#SBATCH --job-name=${INITATMOS_jobname} -#SBATCH --nodes=${INITATMOS_nnodes} # depends on how many boundary files are available -#SBATCH --partition=${INITATMOS_QUEUE} -#SBATCH --gres=${INITATMOS_gres} -#SBATCH --tasks-per-node=${INITATMOS_ncores} # only for benchmark -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e%j # File name for standard error output -#SBATCH --exclusive -##SBATCH --mem=500000 - -export executable=init_atmosphere_model - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - - - -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} -date - - -mv ${SCRIPTS}/log.init_atmosphere.0000.out ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/log.init_atmosphere.0000.x1.${RES}.init.nc.${YYYYMMDDHHi}.out -mv namelist.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -mv streams.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -mv ${SCRIPTS}/x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre - -chmod a+x ${DATAIN}/fixed//x1.${RES}.init.nc -rm -f ${SCRIPTS}/${EXP}\:${start_date:0:13} -rm -f ${SCRIPTS}/init_atmosphere_model -rm -f ${SCRIPTS}/x1.${RES}.graph.info.part.${cores} -rm -f ${SCRIPTS}/x1.${RES}.static.nc -rm -f ${SCRIPTS}/log.init_atmosphere.*.err - -EOF0 -chmod a+x ${SCRIPTS}/initatmos.bash - -echo -e "${GREEN}==>${NC} Executing sbatch initatmos.bash...\n" -cd ${SCRIPTS} -sbatch --wait ${SCRIPTS}/initatmos.bash -mv ${SCRIPTS}/initatmos.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - -if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ] -then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} Init Atmosphere phase fails! Check logs at ${DATAOUT}/logs/initatmos.* .\n" - echo -e "${RED}==>${NC} Exiting script. \n" - exit -1 -fi - diff --git a/scripts.pomerode/make_static.bash b/scripts.pomerode/make_static.bash deleted file mode 100755 index edcc486..0000000 --- a/scripts.pomerode/make_static.bash +++ /dev/null @@ -1,174 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -GEODATA=${DATAIN}/WPS_GEOG -cores=${STATIC_ncores} -#------------------------------------------------------- - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - - - -files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${DATAIN}/namelists/namelist.init_atmosphere.STATIC" "${DATAIN}/namelists/streams.init_atmosphere.STATIC") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -ln -sf ${DATAIN}/fixed/*.TBL ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*.GFS ${SCRIPTS} -ln -sf ${EXECS}/init_atmosphere_model ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.grid.nc ${SCRIPTS} - -sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ - ${DATAIN}/namelists/namelist.init_atmosphere.STATIC \ - > ${SCRIPTS}/namelist.init_atmosphere - -sed -e "s,#RES#,${RES},g" \ - ${DATAIN}/namelists/streams.init_atmosphere.STATIC \ - > ${SCRIPTS}/streams.init_atmosphere - - - -mkdir -p ${DATAOUT}/logs -rm -f ${SCRIPTS}/static.bash -cat << EOF0 > ${SCRIPTS}/static.bash -#!/bin/bash -#SBATCH --job-name=${STATIC_jobname} -#SBATCH --nodes=${STATIC_nnodes} -#SBATCH --ntasks=${STATIC_ncores} -#SBATCH --tasks-per-node=${STATIC_ncpn} -#SBATCH --partition=${STATIC_QUEUE} -#SBATCH --gres=${STATIC_gres} -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/logs/static.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/logs/static.bash.e%j # File name for standard error output -#SBATCH --exclusive -##SBATCH --mem=500000 - - -executable=init_atmosphere_model - -ulimit -s unlimited -ulimit -c unlimited -ulimit -v unlimited - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} -date - -grep "Finished running" log.init_atmosphere.0000.out >& /dev/null -if [ \$? -ne 0 ]; then - echo " BUMMER: Static generation failed for some yet unknown reason." - echo " " - tail -10 ${STATICPATH}/log.init_atmosphere.0000.out - echo " " - exit 21 -fi - -echo " ####################################" -echo " ### Static completed - \$(date) ####" -echo " ####################################" -echo " " - -# -# clean up and remove links -# - -mv log.init_atmosphere.0000.out ${DATAOUT}/logs/log.init_atmosphere.0000.x1.${RES}.static.nc.out - - -EOF0 -chmod a+x ${SCRIPTS}/static.bash - - -echo -e "${GREEN}==>${NC} Executing sbatch static.bash...\n" -cd ${SCRIPTS} -sbatch --wait ${SCRIPTS}/static.bash -mv ${SCRIPTS}/static.bash ${DATAOUT}/logs/ - -if [ -s ${SCRIPTS}/x1.${RES}.static.nc ] -then - mv ${SCRIPTS}/x1.${RES}.static.nc ${DATAIN}/fixed -else - echo -e "${RED}==>${NC} File ${SCRIPTS}/x1.${RES}.static.nc was not created. \n" - exit -1 -fi - -find ${SCRIPTS} -maxdepth 1 -type l -exec rm -f {} \; -rm -f ${SCRIPTS}/log.init_atmosphere.* -rm -f ${SCRIPTS}/streams.init_atmosphere -rm -f ${SCRIPTS}/namelist.init_atmosphere - diff --git a/scripts.pomerode/requirements.txt b/scripts.pomerode/requirements.txt deleted file mode 100755 index 98aff53..0000000 --- a/scripts.pomerode/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -netCDF4==1.6.5 -numpy==1.26.4 diff --git a/scripts.pomerode/run_past2now.bash b/scripts.pomerode/run_past2now.bash deleted file mode 100755 index 302362c..0000000 --- a/scripts.pomerode/run_past2now.bash +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - - - -yyyymmddi=20241001 -yyyymmddf=20241007 -yyyymmdd=${yyyymmddi} - - -while [ ${yyyymmdd} -le ${yyyymmddf} ] -do - - echo "2.pre_processing.bash GFS 1024002 ${yyyymmdd}00 24" - - 2.pre_processing.bash GFS 1024002 ${yyyymmdd}00 24 - - yyyymmdd=$(date -u +%Y%m%d -d "${yyyymmdd} 1 day") -done diff --git a/scripts.pomerode/setenv.bash b/scripts.pomerode/setenv.bash deleted file mode 100755 index 6a6ff77..0000000 --- a/scripts.pomerode/setenv.bash +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash - -# Load modules: - -export MODULEPATH=/dados/monan/pub/modulefiles/monan:$MODULEPATH -module load monan_nvhpc-24.9 -module list - - -# Set environment variables and importants directories-------------------------------------------------- - - -# MONAN-suite install root directories: -# Put your directories: -export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) -export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/dados/monan/marcelo.paiva/scripts_CD-CT/sources/MONAN-Model_feature/monan-631-GPU - -# Submiting variables: - -# PRE-Static phase: -export STATIC_QUEUE="pgpu" -export STATIC_gres="gpu:1" -export STATIC_ncores=32 -export STATIC_nnodes=1 -export STATIC_ncpn=32 -export STATIC_jobname="Pre.static" -export STATIC_walltime="02:00:00" - -# PRE-Degrib phase: -export DEGRIB_QUEUE="pgpu" -export DEGRIB_gres="gpu:1" -export DEGRIB_ncores=1 -export DEGRIB_nnodes=1 -export DEGRIB_ncpn=1 -export DEGRIB_jobname="Pre.degrib" -### export DEGRIB_walltime="00:30:00" not used yet - using STATIC_walltime - -# PRE-Init Atmosphere phase: -export INITATMOS_QUEUE="pgpu" -export INITATMOS_gres="gpu:1" -export INITATMOS_ncores=64 -export INITATMOS_nnodes=1 -### export INITATMOS_ncpn=1 not used yet - using INITATMOS_ncores -export INITATMOS_jobname="Pre.InitAtmos" -### export INITATMOS_walltime="01:00:00" not used yet - using STATIC_walltime - - -# Model phase: -export MODEL_QUEUE="pgpu" -export MODEL_gres="gpu:1" -export MODEL_ncores=128 -export MODEL_nnodes=1 -export MODEL_ncpn=128 -export MODEL_jobname="Model.MONAN" -export MODEL_walltime="2:00:00" - - -# Post phase: -export POST_QUEUE="pgpu" -### export POST_ncores=1 not used yet -export POST_nnodes=1 -export POST_ncpn=32 -export POST_jobname="Post.MONAN" -export POST_walltime="8:00:00" - - -# Products phase: -export PRODS_QUEUE="pgpu" -export PRODS_ncores=1 -export PRODS_nnodes=1 -export PRODS_ncpn=1 -export PRODS_jobname="Prods.MONAN" -export PRODS_walltime="8:00:00" - - -#----------------------------------------------------------------------- -# We discourage changing the variables below: - -# Others variables: -export OMP_NUM_THREADS=1 -#export OMPI_MCA_btl_openib_allow_ib=1 -#export OMPI_MCA_btl_openib_if_include="mlx5_0:1" -export PMIX_MCA_gds=hash -#export MPI_PARAMS="-iface ib0 -bind-to core -map-by core" -export MPI_PARAMS="-iface eno12399np0 -bind-to core -map-by core" -export OMPI_MCA_coll_hcoll_enable=0 - -# Libraries paths: -#export NETCDF=/mnt/beegfs/monan/libs/netcdf -#export PNETCDF=/mnt/beegfs/monan/libs/PnetCDF -export NETCDFDIR=${NETCDF} -export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/dados/monan -export OPERDIR=/oper/dados/ioper/tempo - -# Colors: -export GREEN='\033[1;32m' # Green -export RED='\033[1;31m' # Red -export NC='\033[0m' # No Color -export BLUE='\033[01;34m' # Blue - - -# Functions: ====================================================================================================== - -how_many_nodes () { - nume=${1} - deno=${2} - num=$(echo "${nume}/${deno}" | bc -l) - how_many_nodes_int=$(echo "${num}/1" | bc) - dif=$(echo "scale=0; (${num}-${how_many_nodes_int})*100/1" | bc) - rest=$(echo "scale=0; (((${num}-${how_many_nodes_int})*${deno})+0.5)/1" | bc -l) - if [ ${dif} -eq 0 ]; then how_many_nodes_left=0; else how_many_nodes_left=1; fi - if [ ${how_many_nodes_int} -eq 0 ]; then how_many_nodes_int=1; how_many_nodes_left=0; rest=0; fi - how_many_nodes=$(echo "${how_many_nodes_int}+${how_many_nodes_left}" | bc ) - #echo "INT number of nodes needed: \${how_many_nodes_int} = ${how_many_nodes_int}" - #echo "number of nodes left: \${how_many_nodes_left} = ${how_many_nodes_left}" - echo "The number of nodes needed: \${how_many_nodes} = ${how_many_nodes}" - echo "" -} -#---------------------------------------------------------------------------------------------- - - - -clean_model_tmp_files () { - - echo "Removing all temporary files from last MODEL run trash." - - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/atmosphere_model - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*TBL - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*DBL - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*DATA - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.nc - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.graph.info.part.* - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/Vtable.GFS - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/streams.atmosphere - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stream_list.atmosphere.surface - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stream_list.atmosphere.output - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stream_list.atmosphere.diagnostics - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/namelist.atmosphere - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/MONAN_DIAG_* - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/log.atmosphere.* - echo "" - -} -#---------------------------------------------------------------------------------------------- - - -clean_post_tmp_files () { - - echo "Removing all temporary files from last POST run trash." - - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/dir.* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/PostAtmos_*.sh - - echo "" - -} -#---------------------------------------------------------------------------------------------- - - - -clean_pre_tmp_files () { - - echo "Removing all temporary files from last PRE run trash." - - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/log.*.0000.out - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.init.nc - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/GFS* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/init_atmosphere_model - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/namelist* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/streams.init_atmosphere - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.graph.info.part.* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.static.nc - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/ungrib.exe - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/Vtable - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*.log - - - echo "" - -} -#---------------------------------------------------------------------------------------------- - - - - diff --git a/scripts.pomerode/setenv_python.bash b/scripts.pomerode/setenv_python.bash deleted file mode 100755 index 3e95168..0000000 --- a/scripts.pomerode/setenv_python.bash +++ /dev/null @@ -1,17 +0,0 @@ -echo "loading module python ..." -#module load python-3.9.13-gcc-9.4.0-moxjnc6 - -echo "scripts folder setted=${SCRIPTS}" - -echo "creating python environment at ${SCRIPTS}/../.venv" -python3 -m venv ${SCRIPTS}/../.venv - -echo "activating python environment" -source ${SCRIPTS}/../.venv/bin/activate - -echo "Installing python libraries" -pip install --upgrade pip -pip install -r ${SCRIPTS}/requirements.txt - -export PYTHONPATH=${PYTHONPATH}:${SCRIPTS} -echo "exporting PYTHONPATH=${PYTHONPATH}" diff --git a/scripts.sdumont2/0.run_all_first_time.bash b/scripts.sdumont2/0.run_all_first_time.bash deleted file mode 100755 index ea1a1fa..0000000 --- a/scripts.sdumont2/0.run_all_first_time.bash +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - - -#if [ $# -ne 5 ] -#then -# echo "" -# echo "Instructions: execute the command below" -# echo "" -# echo "${0} GitHubUserRepo EXP_NAME RESOLUTION LABELI FCST" -# echo "" -# echo "GitHubUserRepo :: GitHub link for your personal fork, eg: https://github.com/MYUSER/MONAN-Model.git" -# echo "EXP_NAME :: Forcing: GFS" -# echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" -# echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" -# echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." -# echo "" -# echo "24 hour forcast example:" -# echo "${0} https://github.com/MYUSER/MONAN-Model.git GFS 1024002 2024010100 24" -# echo "" -# exit -#fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - - -# Input variables:----------------------------------------------------- -github_link="https://github.com/monanadmin/MONAN-Model.git" -monan_branch=release/1.1.0 -convertmpas_branch= -EXP=GFS -RES=1024002 -YYYYMMDDHHi=2024042000 -FCST=240 -#---------------------------------------------------------------------- - - -# STEP 1: Installing and compiling the A-MONAN model and utility programs: -time 1.install_monan.bash ${github_link} ${monan_branch} - -# STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -time 2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - -# STEP 3: Executing the Model run: -time 3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - -# STEP 4: Executing the Post of Model run: -time 4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - -exit diff --git a/scripts.sdumont2/1.install_monan.bash b/scripts.sdumont2/1.install_monan.bash deleted file mode 100755 index b9fbe43..0000000 --- a/scripts.sdumont2/1.install_monan.bash +++ /dev/null @@ -1,289 +0,0 @@ -#!/bin/bash - -#-----------------------------------------------------------------------------# -# !SCRIPT: install_monan -# -# !DESCRIPTION: -# Script to install the MONAN model and convert_MPAS. -# -# Performs the following tasks: -# -# o Clone the Monan model github repository in a local directory -# o Make the script make-all.sh that compiles the Atmosphere Model and the Init Atmosphere Model -# o As alternative for advanced users, this script creates a simple compile script that just compile the Atmosphere Model -# o Clone the Convert_mpas tool from the monanadmin repository for convert the output model files in lat-lon grid. -# o Compile the convert_mpas -# -#-----------------------------------------------------------------------------# - -#Fixed parameters ------------------------------------------------------------# -github_link_CONVERT_MPAS="https://github.com/monanadmin/convert_mpas.git" -#-----------------------------------------------------------------------------# - -#Functions -------------------------------------------------------------------# -function checkout_system() { - local source_dir=$1 - local github_link=$2 - local tag_or_branch_name=$3 - if [ -d "${source_dir}" ]; then - echo -e "${GREEN}==>${NC} Source dir already exists, updating it ...\n" - else - echo -e "${GREEN}==>${NC} Cloning your fork repository...\n" - git clone ${github_link} ${source_dir} - if [ ! -d "${source_dir}" ]; then - echo -e "${RED}==>${NC} An error occurred while cloning your fork. Possible causes: wrong URL, user or password.\n" - exit -1 - fi - fi - - cd ${source_dir} - if git checkout "${tag_or_branch_name}" 2>/dev/null; then - git pull - echo -e "${GREEN}==>${NC} Successfully checked out and updated: ${BLUE}${tag_or_branch_name}" - else - echo -e "${RED}==>${NC} Failed to check out branch: ${BLUE}${tag_or_branch_name}" - echo -e "${RED}==>${NC} Please check if you have this branch. Exiting ..." - exit -1 - fi - git log -1 --name-only -} -#-----------------------------------------------------------------------------# - - -if [ $# -lt 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} [G] [M] [C]" - echo "" - echo "G :: MONAN GitHub link of your personal fork, eg: https://github.com/MYUSER/MONAN-Model.git" - echo "M :: MONAN tag or branch name of your personal fork. (will be used 'develop' if not informed)" - echo "C :: Convert_MPAS tag from ${github_link_CONVERT_MPAS} (will be used 'develop' if not informed)" - echo "" - exit -fi - - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -DATAOUTCRON=${DATAOUT}/cron; mkdir -p ${DATAOUTCRON} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:----------------------------------------------------- -github_link_MONAN=${1}; #github_link=https://github.com/monanadmin/MONAN-Model.git -tag_or_branch_name_MONAN=${2} -tag_or_branch_name_MONAN=${tag_or_branch_name_MONAN:="1.0.0"} -echo "MONAN branch name in use: ${tag_or_branch_name_MONAN}" - -tag_or_branch_name_CONVERT_MPAS=${3} -tag_or_branch_name_CONVERT_MPAS=${tag_or_branch_name_CONVERT_MPAS:="1.0.0"} -echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" -#---------------------------------------------------------------------- - - -# Local variables:----------------------------------------------------- -MONANDIR=${SOURCES}/MONAN-Model_${tag_or_branch_name_MONAN} -CONVERT_MPAS_DIR=${SOURCES}/convert_mpas_${tag_or_branch_name_CONVERT_MPAS} -$(sed -i "s;MONANDIR=.*$;MONANDIR=$MONANDIR;" setenv.bash) -#---------------------------------------------------------------------- - -checkout_system ${MONANDIR} ${github_link_MONAN} ${tag_or_branch_name_MONAN} -checkout_system ${CONVERT_MPAS_DIR} ${github_link_CONVERT_MPAS} ${tag_or_branch_name_CONVERT_MPAS} - -rm -rf $MONANDIR/default_inputs/ -rm -f $MONANDIR/stream_list.* $MONANDIR/streams.* $MONANDIR/namelist.* -rm -f $MONANDIR/make*.output.atmosphere $MONANDIR/make*.output.init_atmosphere $MONANDIR/make.sh $MONANDIR/make-all.sh - - -#CR: TODO: maybe later move this make script to main scripts directory. -echo "" -echo -e "${GREEN}==>${NC} Making compile script...\n" - -cd $MONANDIR - -cat << EOF > make-all.sh -#!/bin/bash -#Usage: make target CORE=[core] [options] -#Example targets: -# ifort -# gfortran -# xlf -# pgi -#Availabe Cores: -# atmosphere -# init_atmosphere -# landice -# ocean -# seaice -# sw -# test -#Available Options: -# DEBUG=true - builds debug version. Default is optimized version. -# USE_PAPI=true - builds version using PAPI for timers. Default is off. -# TAU=true - builds version using TAU hooks for profiling. Default is off. -# AUTOCLEAN=true - forces a clean of infrastructure prior to build new core. -# GEN_F90=true - Generates intermediate .f90 files through CPP, and builds with them. -# TIMER_LIB=opt - Selects the timer library interface to be used for profiling the model. Options are: -# TIMER_LIB=native - Uses native built-in timers in MPAS -# TIMER_LIB=gptl - Uses gptl for the timer interface instead of the native interface -# TIMER_LIB=tau - Uses TAU for the timer interface instead of the native interface -# OPENMP=true - builds and links with OpenMP flags. Default is to not use OpenMP. -# OPENACC=true - builds and links with OpenACC flags. Default is to not use OpenACC. -# USE_PIO2=true - links with the PIO 2 library. Default is to use the PIO 1.x library. -# PRECISION=single - builds with default single-precision real kind. Default is to use double-precision. -# SHAREDLIB=true - generate position-independent code suitable for use in a shared library. Default is false. - - -. ${SCRIPTS}/setenv.bash -rm -fr ${MONANDIR}/stream* ${MONANDIR}/namelist.* ${MONANDIR}/make_*output.atmosphere ${MONANDIR}/default_inputs -DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") - -echo "NETCDF: $NETCDF" -echo "NETCDFF: $NETCDFF" -echo "PNETCDF: $PNETCDF" -echo "HDF5: $HDF5" -echo "PIO: $PIO" -echo "" -echo "" -echo "" - -MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" -make clean CORE=atmosphere -make -j 8 nvhpc CORE=atmosphere USE_PIO=true OPENACC=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -#CR: TODO: put verify here if executable was created ok -mv ${MONANDIR}/atmosphere_model ${EXECS} -mv ${MONANDIR}/build_tables ${EXECS} -cp ${MONANDIR}/VERSION.txt ${EXECS} -cp ${MONANDIR}/GF_ConvPar_nml ${SCRIPTS} -make clean CORE=atmosphere - -MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.init_atmosphere" -make clean CORE=init_atmosphere -make -j 8 nvhpc CORE=init_atmosphere USE_PIO=true OPENACC=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -mv ${MONANDIR}/init_atmosphere_model ${EXECS} -make clean CORE=init_atmosphere - - -if [ -s "${EXECS}/init_atmosphere_model" ] && [ -e "${EXECS}/atmosphere_model" ]; then - echo "" - echo -e "${GREEN}==>${NC} Files init_atmosphere_model and atmosphere_model generated Successfully in ${EXECS} !" - echo -else - echo -e "${RED}==>${NC} !!! An error occurred during build. Check output" - exit -1 -fi - -EOF -chmod a+x make-all.sh - - -cat << EOF > make.sh -#!/bin/bash -#Usage: make target CORE=[core] [options] -#Example targets: -# ifort -# gfortran -# xlf -# pgi -#Availabe Cores: -# atmosphere -# init_atmosphere -# landice -# ocean -# seaice -# sw -# test -#Available Options: -# DEBUG=true - builds debug version. Default is optimized version. -# USE_PAPI=true - builds version using PAPI for timers. Default is off. -# TAU=true - builds version using TAU hooks for profiling. Default is off. -# AUTOCLEAN=true - forces a clean of infrastructure prior to build new core. -# GEN_F90=true - Generates intermediate .f90 files through CPP, and builds with them. -# TIMER_LIB=opt - Selects the timer library interface to be used for profiling the model. Options are: -# TIMER_LIB=native - Uses native built-in timers in MPAS -# TIMER_LIB=gptl - Uses gptl for the timer interface instead of the native interface -# TIMER_LIB=tau - Uses TAU for the timer interface instead of the native interface -# OPENMP=true - builds and links with OpenMP flags. Default is to not use OpenMP. -# OPENACC=true - builds and links with OpenACC flags. Default is to not use OpenACC. -# USE_PIO2=true - links with the PIO 2 library. Default is to use the PIO 1.x library. -# PRECISION=single - builds with default single-precision real kind. Default is to use double-precision. -# SHAREDLIB=true - generate position-independent code suitable for use in a shared library. Default is false. - -. ${SCRIPTS}/setenv.bash -rm -fr ${MONANDIR}/stream* ${MONANDIR}/namelist.* ${MONANDIR}/make_*output.atmosphere ${MONANDIR}/default_inputs -DATE_TIME_NOW=\$(date +"%Y%m%d%H%M%S") - -sed -i "s/DMPAS_USE_MPI_F08/DMPAS_USE_MPI_H/" ${MONANDIR}/Makefile -sed -i "s,framework.*$,framework -I../../../../external/esmf_time_f90," ${MONANDIR}/src/core_atmosphere/physics/physics_noahmp/src/Makefile - -MAKE_OUT_FILE="make_\${DATE_TIME_NOW}_.output.atmosphere" -make clean CORE=atmosphere -make -j 8 nvhpc CORE=atmosphere USE_PIO=true OPENACC=true PRECISION=single 2>&1 | tee \${MAKE_OUT_FILE} - -#CR: TODO: put verify here if executable was created ok -mv ${MONANDIR}/atmosphere_model ${EXECS} -mv ${MONANDIR}/build_tables ${EXECS} -make clean CORE=atmosphere - -if [ -e "${EXECS}/atmosphere_model" ]; then - echo "" - echo -e "${GREEN}==>${NC} Files init_atmosphere_model and atmosphere_model generated Successfully in ${EXECS} !" - echo -else - echo -e "${RED}==>${NC} !!! An error occurred during build. Check output" - exit -1 -fi - -EOF -chmod a+x make.sh - - -echo "" -echo -e "${GREEN}==>${NC} Installing init_atmosphere_model and atmosphere_model...\n" -echo "" - -#CR: TODO: maybe at this point we should put our registry-file et all. -#CR: make-all.sh compile all for the first time -#CR: make.sh just compile the A-model -. ${MONANDIR}/make-all.sh - - -# install convert_mpas -echo "" -echo -e "${GREEN}==>${NC} Moduling environment for convert_mpas...\n" -#module load monan_nvhpc-24.9 -module list - -cd ${CONVERT_MPAS_DIR} -echo "" -echo -e "${GREEN}==>${NC} Installing convert_mpas...\n" -make clean -make 2>&1 | tee make.convert.output - -#CR: TODO: put verify here if executable was created ok -mv ${CONVERT_MPAS_DIR}/convert_mpas ${EXECS}/ - -if [ -s "${EXECS}/convert_mpas" ] ; then - echo "" - echo -e "${GREEN}==>${NC} File convert_mpas generated Sucessfully in ${CONVERT_MPAS_DIR} and copied to ${EXECS} !" - echo -else - echo -e "${RED}==>${NC} !!! An error occurred during convert_mpas build. Check output" - exit -1 -fi - diff --git a/scripts.sdumont2/2.pre_processing.bash b/scripts.sdumont2/2.pre_processing.bash deleted file mode 100755 index 485bed6..0000000 --- a/scripts.sdumont2/2.pre_processing.bash +++ /dev/null @@ -1,137 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: pre_processing -# -# !DESCRIPTION: -# Script to prepare boundary and initials conditions for MONAN model. -# -# Performs the following tasks: -# -# o Creates topography, land use and static variables -# o Ungrib GFS data -# o Interpolates to model the grid -# o Creates initial and boundary conditions -# o Creates scripts to run the model and post-processing (CR: to be modified to phase 3 and 4) -# o Integrates the MONAN model ((CR: to be modified to phase 3) -# o Post-processing (netcdf for grib2, latlon regrid, crop) (CR: to be modified to phase 4) -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME/OP RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "OP :: clean: remove all temporary files createed in the last run." - 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)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forecast example for 24km:" - echo "${0} GFS 1024002 2024010100 24" - echo "48 hour forecast example for 120km:" - echo "${0} GFS 40962 2024010100 48" - echo "Cleannig temp files example:" - echo "${0} clean" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -if [ $# -eq 1 ] -then - op=$(echo "${1}" | tr '[A-Z]' '[a-z]') - if [ ${op} = "clean" ] - then - clean_pre_tmp_files - exit - else - echo "Should type just \"clean\" for cleanning." - echo "${0} clean" - echo "" - exit - fi -fi - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -# Calculating CIs and final forecast dates in model namelist format: -yyyymmddi=${YYYYMMDDHHi:0:8} -hhi=${YYYYMMDDHHi:8:2} -yyyymmddhhf=$(date +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${FCST} hours" ) -final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhhf:8:2}.00.00 -#------------------------------------------------------- - - -echo -e "${GREEN}==>${NC} Scripts_CD-CT last commit: \n" -git log -1 --name-only -git branch | head -1 - - -# Untar the fixed files: -# x1.${RES}.graph.info.part. files can be found in datain/fixed -# *.TBL files also can be found in datain/fixed -# x1.${RES}.grid.nc also can be found in datain/fixed - -echo -e "${GREEN}==>${NC} copying and linking fixed input data... \n" -mkdir -p ${DATAIN} -rsync -rv --chmod=ugo=rw ${DIRDADOS}/MONAN_datain/datain/fixed ${DATAIN} -rsync -rv --chmod=ugo=rwx ${DIRDADOS}/MONAN_datain/execs ${DIRHOMED} -ln -sf ${DIRDADOS}/MONAN_datain/datain/WPS_GEOG ${DATAIN} - -# 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} -else - echo -e "${GREEN}==>${NC} File x1.${RES}.static.nc already exist in ${DATAIN}/fixed.\n" -fi -#---------------------------------------------------------------------------------- - - - -# Degrib phase:--------------------------------------------------------------------- -echo -e "${GREEN}==>${NC} Submiting Degrib...\n" -time ./make_degrib.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#---------------------------------------------------------------------------------- - - - -# Init Atmosphere phase:------------------------------------------------------------ -echo -e "${GREEN}==>${NC} Submiting Init Atmosphere...\n" -time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -#---------------------------------------------------------------------------------- - - - - diff --git a/scripts.sdumont2/3.run_model.bash b/scripts.sdumont2/3.run_model.bash deleted file mode 100755 index f7568ec..0000000 --- a/scripts.sdumont2/3.run_model.bash +++ /dev/null @@ -1,247 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: run_model -# -# !DESCRIPTION: -# Script to run the MONAN model over the forecast horizon. -# -# Performs the following tasks: -# -# o VCheck all input files before -# o Creates the submition script -# o Submit the model -# o Veriffy all files generated -# -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} [EXP_NAME/OP] RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "OP :: clean: remove all temporary files createed in the last run." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forecast example for 24km:" - echo "${0} GFS 1024002 2024010100 24" - echo "48 hour forecast example for 120km:" - echo "${0} GFS 40962 2024010100 48" - echo "Cleannig temp files example:" - echo "${0} clean" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -if [ $# -eq 1 ] -then - op=$(echo "${1}" | tr '[A-Z]' '[a-z]') - if [ ${op} = "clean" ] - then - clean_model_tmp_files - exit - else - echo "Should type just \"clean\" for cleanning." - echo "${0} clean" - echo "" - exit - fi -fi - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=6 -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -cores=${MODEL_ncores} -hhi=${YYYYMMDDHHi:8:2} -NLEV=55 -CONFIG_CONV_INTERVAL="00:30:00" - -# Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - CONFIG_DT=150.0 - CONFIG_LEN_DISP=24000.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 2621442 ]; then #15Km - CONFIG_DT=90.0 - CONFIG_LEN_DISP=15000.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 40962 ]; then #120Km - CONFIG_DT=600.0 - CONFIG_LEN_DISP=120000.0 -fi -#------------------------------------------------------- - - -# Calculating final forecast dates in model namelist format: DD_HH:MM:SS -# using: start_date(yyyymmdd) + FCST(hh) : -ind=$(printf "%02d\n" $(echo "${FCST}/24" | bc)) -inh=$(printf "%02.0f\n" $(echo "((${FCST}/24)-${ind})*24" | bc -l)) -DD_HHMMSS_forecast=$(echo "${ind}_${inh}:00:00") - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - -clean_model_tmp_files - -files_needed=("${DATAIN}/namelists/stream_list.atmosphere.output" ""${DATAIN}/namelists/stream_list.atmosphere.diagnostics "${DATAIN}/namelists/stream_list.atmosphere.surface" "${EXECS}/atmosphere_model" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${DATAIN}/fixed/Vtable.GFS") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -ln -sf ${EXECS}/atmosphere_model ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*TBL ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*DBL ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*DATA ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.static.nc ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${SCRIPTS} -ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${SCRIPTS} -ln -sf ${DATAIN}/fixed/Vtable.GFS ${SCRIPTS} - - -if [ ${EXP} = "GFS" ] -then - sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; -s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g" \ - ${DATAIN}/namelists/namelist.atmosphere.TEMPLATE > ${SCRIPTS}/namelist.atmosphere - - sed -e "s,#RES#,${RES},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ - ${DATAIN}/namelists/streams.atmosphere.TEMPLATE > ${SCRIPTS}/streams.atmosphere -fi -cp -f ${DATAIN}/namelists/stream_list.atmosphere.output ${SCRIPTS} -cp -f ${DATAIN}/namelists/stream_list.atmosphere.diagnostics ${SCRIPTS} -cp -f ${DATAIN}/namelists/stream_list.atmosphere.surface ${SCRIPTS} - - - -rm -f ${SCRIPTS}/model.bash -cat << EOF0 > ${SCRIPTS}/model.bash -#!/bin/bash -#SBATCH --job-name=${MODEL_jobname} -#SBATCH --nodes=${MODEL_nnodes} -#SBATCH --ntasks=${MODEL_ncores} -#SBATCH --tasks-per-node=${MODEL_ncpn} -#SBATCH --partition=${MODEL_QUEUE} -#SBATCH --time=${MODEL_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e%j # File name for standard error output -#SBATCH --exclusive -##SBATCH --mem=500000 - -export executable=atmosphere_model - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} -date - -# -# move dataout, clean up and remove files/links -# - -mv MONAN_DIAG_* ${DATAOUT}/${YYYYMMDDHHi}/Model -mv MONAN_HIST_* ${DATAOUT}/${YYYYMMDDHHi}/Model -cp ${EXECS}/VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Model - -mv log.atmosphere.*.out ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv log.atmosphere.*.err ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv namelist.atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Model/logs -mv stream* ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - -rm -f ${SCRIPTS}/atmosphere_model -rm -f ${SCRIPTS}/*TBL -rm -f ${SCRIPTS}/*.DBL -rm -f ${SCRIPTS}/*DATA -rm -f ${SCRIPTS}/x1.${RES}.static.nc -rm -f ${SCRIPTS}/x1.${RES}.graph.info.part.${cores} -rm -f ${SCRIPTS}/Vtable.GFS -rm -f ${SCRIPTS}/x1.${RES}.init.nc - - - -EOF0 -chmod a+x ${SCRIPTS}/model.bash - - -echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model and waiting for finish before exit... \n" -echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/logs... \n" -echo -e "sbatch ${SCRIPTS}/model.bash" -sbatch --wait ${SCRIPTS}/model.bash -mv ${SCRIPTS}/model.bash ${DATAOUT}/${YYYYMMDDHHi}/Model/logs - - -output_interval=3 -for i in $(seq 0 ${output_interval} ${FCST}) -do - hh=${YYYYMMDDHHi:8:2} - currentdate=$(date -u +"%Y%m%d%H" -d "${YYYYMMDDHHi:0:8} ${hh}:00 ${i} hours") - file=MONAN_DIAG_G_MOD_GFS_${YYYYMMDDHHi}_${currentdate}.00.00.x${RES}L55.nc - - if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} was not generated. \n" - exit -1 - fi - -done - - diff --git a/scripts.sdumont2/4.run_post.bash b/scripts.sdumont2/4.run_post.bash deleted file mode 100755 index 63b40d0..0000000 --- a/scripts.sdumont2/4.run_post.bash +++ /dev/null @@ -1,306 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: run_post -# -# !DESCRIPTION: -# Script to run the pos-processing of MONAN model over the forecast horizon. -# -# Performs the following tasks: -# -# o VCheck all input files before -# o Creates the submition script -# o Submit the post -# o Veriffy all files generated -# -# -#-----------------------------------------------------------------------------# - -if [ $# -ne 4 -a $# -ne 1 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} ]EXP_NAME/OP] RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo "OP :: clean: remove all temporary files createed in the last run." - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "${0} GFS 40962 2024010100 48" - echo "Cleannig temp files example:" - echo "${0} clean" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - -if [ $# -eq 1 ] -then - op=$(echo "${1}" | tr '[A-Z]' '[a-z]') - if [ ${op} = "clean" ] - then - clean_post_tmp_files - exit - else - echo "Should type just \"clean\" for cleanning." - echo "${0} clean" - echo "" - exit - fi -fi - - - -# Standart directories variables:--------------------------------------- -DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} -DIRHOMED=${DIR_DADOS}/scripts_CD-CT; mkdir -p ${DIRHOMED} -export SCRIPTS=${DIRHOMES}/scripts; mkdir -p ${SCRIPTS} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024042000 -FCST=${4}; #FCST=40 -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Post/logs - - -# Local variables-------------------------------------- -START_DATE_YYYYMMDD="${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}" -START_HH="${YYYYMMDDHHi:8:2}" -maxpostpernode=20 # <------ qtde max de convert_mpas por no! -#------------------------------------------------------- - -# Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - NLAT=720 #180/0.25 - NLON=1440 #360/0.25 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 2621442 ]; then #15Km - NLAT=1200 #180/0.15 - NLON=2400 #360/0.15 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 40962 ]; then #120Km - #CR-TODO: verificar se precisa corrigir para esta resolucao tambem: - NLAT=181 - NLON=361 - STARTLAT=-90.5 - STARTLON=-0.5 - ENDLAT=90.5 - ENDLON=360.5 -fi -#------------------------------------------------------- - -clean_post_tmp_files - -files_needed=("${DATAIN}/namelists/include_fields.diag" "${DATAIN}/namelists/convert_mpas.nml" "${DATAIN}/namelists/target_domain.TEMPLATE" "${EXECS}/convert_mpas" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -# Captura quantos arquivos do modelo tiverem para serem pos-processados e -# quando nos serao necessarios para executar ${maxpostpernode} convert_mpas por no: -#nfiles=$(ls -l ${DATAOUT}/${YYYYMMDDHHi}/Model/MONAN*nc | wc -l) -# from streams.atmosphere.TEMPLATE in diagnostics the output_interval is 3 hours -output_interval=3 -#nfiles=FCST/output_interval + 1(time zero file) -nfiles=$(echo "$FCST/$output_interval + 1" | bc) -echo "${nfiles} post to submit." -echo "Max ${maxpostpernode} submits per nodes." -how_many_nodes ${nfiles} ${maxpostpernode} - -# Cria os diretorios e arquivos/links para cada saida do convert_mpas: -cd ${SCRIPTS} -for ii in $(seq 1 ${nfiles}) -do - i=$(printf "%03d" ${ii}) - mkdir -p ${SCRIPTS}/dir.${i} - - ln -sf ${DATAIN}/namelists/include_fields.diag ${SCRIPTS}/dir.${i}/include_fields.diag - ln -sf ${DATAIN}/namelists/convert_mpas.nml ${SCRIPTS}/dir.${i}/convert_mpas.nml - sed -e "s,#NLAT#,${NLAT},g;s,#NLON#,${NLON},g;s,#STARTLAT#,${STARTLAT},g;s,#ENDLAT#,${ENDLAT},g;s,#STARTLON#,${STARTLON},g;s,#ENDLON#,${ENDLON},g;" \ - ${DATAIN}/namelists/target_domain.TEMPLATE > ${SCRIPTS}/dir.${i}/target_domain - - rm -rf ${SCRIPTS}/dir.${i}/convert_mpas - ln -sf ${EXECS}/convert_mpas ${SCRIPTS}/dir.${i} - ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${SCRIPTS}/dir.${i} - - hh=${YYYYMMDDHHi:8:2} - currentdate=$(date -d "${YYYYMMDDHHi:0:8} ${hh}:00 $(echo "(${i}-1)*3" | bc) hours" +"%Y%m%d%H") - diag_name=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_${currentdate}.00.00.x${RES}L55.nc - #CR-TODO: verificar se o arq existe antes de fazer o link: - ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Model/${diag_name} ${SCRIPTS}/dir.${i} -done - -cd ${SCRIPTS} -. ${SCRIPTS}/setenv_python.bash - -# Laco para criar os arquivos de submissao com os blocos de convertmpas para cada node: -node=1 -inicio=1 -fim=$((maxpostpernode <= nfiles ? maxpostpernode : nfiles)) -while [ ${inicio} -le ${nfiles} ] -do -cat > ${SCRIPTS}/PostAtmos_node.${node}.sh < convert_mpas.output & - echo "./convert_mpas x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Model/\${diag_name} > convert_mpas.output" - -done - -# necessario aguardar as rodadas em background -wait - -for ii in \$(seq ${inicio} ${fim}) -do - i=\$(printf "%03d" \${ii}) - cd ${SCRIPTS}/dir.\${i} - python ${SCRIPTS}/group_levels.py ${SCRIPTS}/dir.\${i} latlon.nc latlon_\${i}.nc > saida_python.txt & -done - -wait - -# unload the python's environment -deactivate - -for ii in \$(seq ${inicio} ${fim}) -do - i=\$(printf "%03d" \${ii}) - cd ${SCRIPTS}/dir.\${i} - rm -f ${DATAOUT}/${YYYYMMDDHHi}/Post/latlon_\${i}.nc - cp -f latlon_\${i}.nc ${DATAOUT}/${YYYYMMDDHHi}/Post/ & -done -wait - -EOSH - - chmod a+x ${SCRIPTS}/PostAtmos_node.${node}.sh - jobid[${node}]=$(sbatch --parsable ${SCRIPTS}/PostAtmos_node.${node}.sh) - echo "JobId node ${node} = ${jobid[${node}]} , convert_mpas ${inicio} to ${fim}" - - inicio=$((fim + 1)) - temp=$((fim + maxpostpernode)) - fim=$(( temp < nfiles ? temp : nfiles )) - node=$((node+1)) -done - -# Dependencias JobId: -dependency="afterok" -for job_id in "${jobid[@]}" -do - dependency="${dependency}:${job_id}" -done - - - - - -# Script principal para juntar os arquivos finais em um unico: -node=0 -cat > ${SCRIPTS}/PostAtmos_node.${node}.sh <\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=6 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -yyyymmddi=${YYYYMMDDHHi:0:8} -hhi=${YYYYMMDDHHi:8:2} -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Prods/logs - - -#for nh in $(seq 1 ${FCST}) -#do - nh=2 - yyyymmddhhf=$(date -u +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${nh} hours" ) - yyyymmddhhff=$(date -u +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 $((nh+1)) hours" ) - -rm -f ${DATAOUT}/${YYYYMMDDHHi}/Prods/MONAN_PREC_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhff}.00.00.x${RES}L55.png -rm -f ${SCRIPTS}/prec.gs -cat << EOGS > ${SCRIPTS}/prec.gs -'reinit' -'set display color white' -'c' -'set gxout shaded' - -'sdfopen ${DATAOUT}/${YYYYMMDDHHi}/Post/MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhf}.00.00.x${RES}L55.nc' -'sdfopen ${DATAOUT}/${YYYYMMDDHHi}/Post/MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhff}.00.00.x${RES}L55.nc' -'set mpdset mres' -'set grads off' - -'set lon 276.25 339.5' -'set lat -55.75 14.25' - -'pr1=rainc.1+rainnc.1' -'pr25=rainc.2(t=1)+rainnc.2(t=1)' - -'set clevs 0.5 1 2 4 8 16 32 64 128' -'set ccols 0 14 11 5 13 10 7 12 2 6' - -'d pr25-pr1' -'set gxout contour' - -'cbar' -'draw title Previsao de Precipitacao \ MONAN: prod: 2024010100 valid: 2024010102' - -'set strsiz 0.15 0.15' -'draw string 7.8 0.3 (mm)' -'set strsiz 0.10 0.10' -'set string 1 l 5' -'draw string 0.1 0.1 MONAN v.0.4.0' - - -'printim ${DATAOUT}/${YYYYMMDDHHi}/Prods/MONAN_PREC_${EXP}_${YYYYMMDDHHi}_${yyyymmddhhff}.00.00.x${RES}L55.png' -'quit' - - - -EOGS - - -cat << EOF0 > ${SCRIPTS}/prods.bash -#!/bin/bash -#SBATCH --job-name=${PRODS_jobname} -#SBATCH --nodes=${PRODS_nnodes} -#SBATCH --ntasks=${PRODS_ncores} -#SBATCH --tasks-per-node=${PRODS_ncpn} -#SBATCH --partition=${PRODS_QUEUE} -#SBATCH --time=${PRODS_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Prods/logs/prods.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Prods/logs/prods.bash.e%j # File name for standard error output -##SBATCH --exclusive -##SBATCH --mem=500000 - - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - -date -time grads -bpcx "run prec.gs" -date - - -EOF0 -chmod a+x ${SCRIPTS}/prods.bash - - -echo -e "${GREEN}==>${NC} Submitting MONAN atmosphere model Products and waiting for finish before exit... \n" -echo -e "${GREEN}==>${NC} Logs being generated at ${DATAOUT}/${YYYYMMDDHHi}/Prods/logs... \n" -echo -e "sbatch ${SCRIPTS}/prods.bash" -sbatch --wait ${SCRIPTS}/prods.bash -rm -f ${SCRIPTS}/prods.bash diff --git a/scripts.sdumont2/6.do_manut.bash b/scripts.sdumont2/6.do_manut.bash deleted file mode 100755 index 74fd325..0000000 --- a/scripts.sdumont2/6.do_manut.bash +++ /dev/null @@ -1,94 +0,0 @@ -#!/bin/bash -#-----------------------------------------------------------------------------# -# !SCRIPT: do_manut -# -# !DESCRIPTION: -# Script that maintains the MONAN model suite healthy. -# -# Performs the following tasks: -# -# o Feeds public areas (FTP) with important files (figures, outputs, -# clippings, etc.) -# o Removes temporary files with no value that are eventually generated -# during integration. -# o Performs maintenance on the area occupied by the model, moving old -# outputs to their destination area. -# -# -#-----------------------------------------------------------------------------# - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart directories variables:---------------------- -DIRHOME=${DIRWORK}/../../MONAN; mkdir -p ${DIRHOME} -SCRIPTS=${DIRHOME}/scripts; mkdir -p ${SCRIPTS} -DATAIN=${DIRHOME}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOME}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOME}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOME}/execs; mkdir -p ${EXECS} -#------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- -cp -f setenv.bash ${SCRIPTS} - - -# Local variables-------------------------------------- -#------------------------------------------------------- - - -# TODO compress all output files - -# +cat > Compress_exe.sh <> ${LOG_FILE} 2>&1 -# +tar -cf - diagnostics_${START_DATE_YYYYMMDD}.nc | xz -9 -c - > diagnostics_${START_DATE_YYYYMMDD}.tar.xz -# + -# +#echo -e "Compressing all /monanprd/diag*.nc files...\n" >> ${LOG_FILE} 2>&1 -# +#tar -cf - ${EXPDIR}/monanprd | xz -9 -c - > monanprd_${START_DATE_YYYYMMDD}.tar.xz -# + -# +exit 0 -# +EOF0 -# + -# +chmod +x Compress_exe.sh - - diff --git a/scripts.sdumont2/group_levels.py b/scripts.sdumont2/group_levels.py deleted file mode 100755 index 6acb4f1..0000000 --- a/scripts.sdumont2/group_levels.py +++ /dev/null @@ -1,107 +0,0 @@ - -import netCDF4 as nc -import numpy as np -import re -import sys - - -def main(data_dir, file_in, file_out, levels=[1000, 975, 950, 925, 900, 875, 850, 825, 700, 600, 500, 400, \ - 300, 250, 200, 150, 100, 70, 50, 30, 20, 15]): - """ - This function takes in the data directory, input file name, and output file name. - It reads the input NetCDF file, groups variables based on their names, - creates a new NetCDF file with dimensions and variables copied from the input file, - and saves the concatenated variables to the new NetCDF file. - - Parameters: - data_dir (str): The directory where the input and output NetCDF files are located. - file_in (str): The name of the input NetCDF file. - file_out (str): The name of the output NetCDF file. - - Returns: - None - """ - - nc_file_in = nc.Dataset(f'{data_dir}/{file_in}', 'r') - # Save the concatenated variables to a new NetCDF file - nc_file_out = nc.Dataset(f'{data_dir}/{file_out}', 'w') - - dimensions_4D = ('time', 'level', 'latitude', 'longitude') - # Group variables based on their names - variable_groups = {} - first_hpa_variable = '' - for name, variable in reversed(list(nc_file_in.variables.items())): # reverse to be consistent to levels - # if 'hPa' in name or name in dimensions_4D: - if 'hPa' in name: - variable_type = re.split('_.\d*hPa', name)[0] # Extract the variable type (e.g., '15hPa', '20hPa') - first_hpa_variable = variable_type if first_hpa_variable == '' else first_hpa_variable - else: - variable_type = name.lower() - if variable_type not in variable_groups: - variable_groups[variable_type] = [variable] - else: - variable_groups[variable_type].append(variable) - - level_dimension_size = len(variable_groups[first_hpa_variable]) - - # Copy dimensions Time, latitude, longitude - for dim_name, dim_type in nc_file_in.dimensions.items(): - if dim_name.lower() in ['time', 'latitude', 'longitude']: - nc_file_out.createDimension(dim_name.lower(), dim_type.size) - nc_file_out.createDimension('level', level_dimension_size) - - - # Copy variables - for variable_type, variables in variable_groups.items(): - print(f'Creating var {variable_type}') - if variable_type == 'level': - new_variable = nc_file_out.createVariable(variable_type, variables[0].dtype, (variable_type) ) - new_variable.setncatts({k: variables[0].getncattr(k) for k in variables[0].ncattrs()}) - new_variable[:] = range(level_dimension_size, 0, -1) if levels is None else levels - new_variable.setncattr('positive', "down") - new_variable.setncattr('units', "hPa") - # if its variables with on isobaric level per variable - elif len(variables) == level_dimension_size: - new_variable = nc_file_out.createVariable(variable_type, variables[0].dtype, dimensions_4D) - new_variable.setncatts({k: variables[0].getncattr(k) for k in variables[0].ncattrs()}) - if 'vertically interpolated' in new_variable.getncattr('long_name'): - new_long_name = new_variable.getncattr('long_name').split('vertically interpolated')[0].strip() - elif 'interpolated' in new_variable.getncattr('long_name'): - new_long_name = new_variable.getncattr('long_name').split('interpolated')[0].strip() - elif '1000 hPa' in new_variable.getncattr('long_name'): - new_long_name = new_variable.getncattr('long_name').split('1000 hPa')[0].strip() - else: - new_long_name = new_variable.getncattr('long_name') - new_long_name += ' interpolated' - new_variable.setncattr('long_name', new_long_name) - - for i in range(level_dimension_size): - new_variable[:,i,:,:] = variables[i][:] - else: - # Create an empty list to store lowercase dimensions - lowercase_dimensions = [] - - # Iterate through each object in the tuple - for obj in variables[0].dimensions: - # Access the 'dimensions' attribute and convert to lowercase - lowercase_dimensions.append(obj.lower()) - # Convert the list of lowercase dimensions to a tuple - - lowercase_dimensions_tuple = tuple(lowercase_dimensions) - # variable_type in ('latitude', 'longitude', 'Time'): - new_variable = nc_file_out.createVariable(variable_type, variables[0].dtype, lowercase_dimensions_tuple) - new_variable.setncatts({k: variables[0].getncattr(k) for k in variables[0].ncattrs()}) - new_variable[:] = variables[0][:] - - nc_file_out.close() - nc_file_in.close() - - -if __name__ == "__main__": - import sys - - if len(sys.argv) != 4: - print(f"Usage: python {sys.argv[0]} ") - sys.exit(1) - - main(sys.argv[1], sys.argv[2], sys.argv[3]) diff --git a/scripts.sdumont2/link_grib.csh b/scripts.sdumont2/link_grib.csh deleted file mode 100755 index e2212b1..0000000 --- a/scripts.sdumont2/link_grib.csh +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env -S csh -f - -set alpha = ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) -set i1 = 1 -set i2 = 1 -set i3 = 1 - -if ( ( ${#argv} == 1 ) || ( ( ${#argv} == 2 ) && ( ${2} == "." ) ) ) then - - rm -f GRIBFILE.??? >& /dev/null - - foreach f ( ${1}* ) - - ln -sf ${f} GRIBFILE.$alpha[$i3]$alpha[$i2]$alpha[$i1] - @ i1 ++ - - if ( $i1 > 26 ) then - set i1 = 1 - @ i2 ++ - if ( $i2 > 26 ) then - set i2 = 1 - @ i3 ++ - if ( $i3 > 26 ) then - echo "RAN OUT OF GRIB FILE SUFFIXES!" - endif - endif - endif - - end -else if ( ${#argv} > 1 ) then - - rm -f GRIBFILE.??? >& /dev/null - - foreach f ( $* ) - - if ( $f != "." ) then - ln -sf ${f} GRIBFILE.$alpha[$i3]$alpha[$i2]$alpha[$i1] - @ i1 ++ - - if ( $i1 > 26 ) then - set i1 = 1 - @ i2 ++ - if ( $i2 > 26 ) then - set i2 = 1 - @ i3 ++ - if ( $i3 > 26 ) then - echo "RAN OUT OF GRIB FILE SUFFIXES!" - endif - endif - endif - endif - - end -else if ( ${#argv} == 0 ) then - echo " " - echo " " - echo " Please provide some GRIB data to link" - echo " usage: $0 path_to_grib_data/grib_data_root" - echo " " - echo " " -endif - diff --git a/scripts.sdumont2/make_degrib.bash b/scripts.sdumont2/make_degrib.bash deleted file mode 100755 index 6aa368d..0000000 --- a/scripts.sdumont2/make_degrib.bash +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "${0} GFS 40962 2024010100 48" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -OPERDIREXP=${OPERDIR}/${EXP} -BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} -GCCCIS=/scratch/cptec/dados/CIs/${EXP} -#------------------------------------------------------- -mkdir -p ${DATAIN}/${YYYYMMDDHHi} -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - -#mkdir -p ${HOME}/local/lib64 -#cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 -#cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 - - -# Se nao existir CI no diretorio do IO, -# busca no nosso dir /dados/monan/MONAN_datain/CIs, se nao existir tbm, aborta! -if [ ! -s ${BNDDIR}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] -then - if [ ! -s ${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] - then - echo -e "${RED}==>${NC}Condicao de contorno inexistente !" - echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}" - exit 1 - else - BNDDIR=${GCCCIS}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} - fi -fi - -files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${BNDDIR}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -ln -sf ${DATAIN}/fixed/x1.${RES}.static.nc ${SCRIPTS} -ln -sf ${DATAIN}/fixed/Vtable.${EXP} ${SCRIPTS}/Vtable -ln -sf ${EXECS}/ungrib.exe ${SCRIPTS} -cp -rf ${BNDDIR}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} - - - - -rm -f ${SCRIPTS}/degrib.bash -cat << EOF0 > ${SCRIPTS}/degrib.bash -#!/bin/bash -#SBATCH --job-name=${DEGRIB_jobname} -#SBATCH --nodes=${DEGRIB_nnodes} -#SBATCH --partition=${DEGRIB_QUEUE} -#SBATCH --ntasks=${DEGRIB_ncores} -#SBATCH --tasks-per-node=${DEGRIB_ncpn} # ic for benchmark -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e%j # File name for standard error output -# - -ulimit -s unlimited -ulimit -c unlimited -ulimit -v unlimited - -export PMIX_MCA_gds=hash - -#export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 -#ldd ungrib.exe - -cd ${SCRIPTS} -. setenv.bash - - -rm -f GRIBFILE.* namelist.wps - - -sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ - ${DATAIN}/namelists/namelist.wps.TEMPLATE > ./namelist.wps - -./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 - - -date -time mpirun -np 1 ungrib.exe -date - - -grep "Successful completion of program ungrib.exe" ${SCRIPTS}/ungrib.log >& /dev/null - -if [ \$? -ne 0 ]; then - echo " BUMMER: Ungrib generation failed for some yet unknown reason." - echo " " - tail -10 ${SCRIPTS}/ungrib.log - echo " " - exit 21 -fi - -# -# clean up and remove links -# - mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log - mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps - mv GFS\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre - - rm -f ${SCRIPTS}/ungrib.exe - rm -f ${SCRIPTS}/Vtable - rm -f ${SCRIPTS}/x1.${RES}.static.nc - rm -f ${SCRIPTS}/GRIBFILE.AAA - rm -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t00z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 - - -echo "End of degrib Job" - - -EOF0 -chmod a+x ${SCRIPTS}/degrib.bash - -echo -e "${GREEN}==>${NC} Executing sbatch degrib.bash...\n" -cd ${SCRIPTS} -sbatch --wait ${SCRIPTS}/degrib.bash -mv ${SCRIPTS}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - - - -files_ungrib=("${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}") -for file in "${files_ungrib[@]}" -do - if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${file} ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} Degrib fails! At least the file ${file} was not generated at ${DATAIN}/${YYYYMMDDHHi}. \n" - echo -e "${RED}==>${NC} Check logs at ${DATAOUT}/logs/degrib.* .\n" - echo -e "${RED}==>${NC} Exiting script. \n" - exit -1 - fi -done - diff --git a/scripts.sdumont2/make_initatmos.bash b/scripts.sdumont2/make_initatmos.bash deleted file mode 100755 index 29ed9aa..0000000 --- a/scripts.sdumont2/make_initatmos.bash +++ /dev/null @@ -1,159 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -GEODATA=${DATAIN}/WPS_GEOG -cores=${INITATMOS_ncores} -#------------------------------------------------------- -mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - cd ${DATAIN}/fixed - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - - -files_needed=("${DATAIN}/namelists/namelist.init_atmosphere.TEMPLATE" "${DATAIN}/namelists/streams.init_atmosphere.TEMPLATE" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}:${start_date:0:13}" "${EXECS}/init_atmosphere_model") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - - -sed -e "s,#LABELI#,${start_date},g;s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ - ${DATAIN}/namelists/namelist.init_atmosphere.TEMPLATE > ${SCRIPTS}/namelist.init_atmosphere - -sed -e "s,#RES#,${RES},g" \ - ${DATAIN}/namelists/streams.init_atmosphere.TEMPLATE > ${SCRIPTS}/streams.init_atmosphere - - -ln -sf ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.static.nc ${SCRIPTS} -ln -sf ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}\:${start_date:0:13} ${SCRIPTS} -ln -sf ${EXECS}/init_atmosphere_model ${SCRIPTS} - - -rm -f ${SCRIPTS}/initatmos.bash -cat << EOF0 > ${SCRIPTS}/initatmos.bash -#!/bin/bash -#SBATCH --job-name=${INITATMOS_jobname} -#SBATCH --nodes=${INITATMOS_nnodes} # depends on how many boundary files are available -#SBATCH --partition=${INITATMOS_QUEUE} -#SBATCH --tasks-per-node=${INITATMOS_ncores} # only for benchmark -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e%j # File name for standard error output -#SBATCH --exclusive -##SBATCH --mem=500000 - -export executable=init_atmosphere_model - -ulimit -c unlimited -ulimit -v unlimited -ulimit -s unlimited - - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - - - -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} -date - - -mv ${SCRIPTS}/log.init_atmosphere.0000.out ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/log.init_atmosphere.0000.x1.${RES}.init.nc.${YYYYMMDDHHi}.out -mv namelist.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -mv streams.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -mv ${SCRIPTS}/x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre - -chmod a+x ${DATAIN}/fixed//x1.${RES}.init.nc -rm -f ${SCRIPTS}/${EXP}\:${start_date:0:13} -rm -f ${SCRIPTS}/init_atmosphere_model -rm -f ${SCRIPTS}/x1.${RES}.graph.info.part.${cores} -rm -f ${SCRIPTS}/x1.${RES}.static.nc -rm -f ${SCRIPTS}/log.init_atmosphere.*.err - -EOF0 -chmod a+x ${SCRIPTS}/initatmos.bash - -echo -e "${GREEN}==>${NC} Executing sbatch initatmos.bash...\n" -cd ${SCRIPTS} -sbatch --wait ${SCRIPTS}/initatmos.bash -mv ${SCRIPTS}/initatmos.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - -if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ] -then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} Init Atmosphere phase fails! Check logs at ${DATAOUT}/logs/initatmos.* .\n" - echo -e "${RED}==>${NC} Exiting script. \n" - exit -1 -fi - diff --git a/scripts.sdumont2/make_static.bash b/scripts.sdumont2/make_static.bash deleted file mode 100755 index 7b859e7..0000000 --- a/scripts.sdumont2/make_static.bash +++ /dev/null @@ -1,173 +0,0 @@ -#!/bin/bash - - -if [ $# -ne 4 ] -then - echo "" - echo "Instructions: execute the command below" - echo "" - echo "${0} EXP_NAME RESOLUTION LABELI FCST" - echo "" - echo "EXP_NAME :: Forcing: GFS" - echo " :: Others options to be added later..." - echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" - echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" - echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." - echo "" - echo "24 hour forcast example:" - echo "${0} GFS 1024002 2024010100 24" - echo "" - - exit -fi - -# Set environment variables exports: -echo "" -echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" -. setenv.bash - - -# Standart 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} -DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} -DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} -SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} -EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} -#---------------------------------------------------------------------- - - -# Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -RES=${2}; #RES=1024002 -YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 -FCST=${4}; #FCST=24 -#------------------------------------------------------- - - -# Local variables-------------------------------------- -GEODATA=${DATAIN}/WPS_GEOG -cores=${STATIC_ncores} -#------------------------------------------------------- - - -if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] -then - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz - tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" - cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz -fi - - - -files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${DATAIN}/namelists/namelist.init_atmosphere.STATIC" "${DATAIN}/namelists/streams.init_atmosphere.STATIC") -for file in "${files_needed[@]}" -do - if [ ! -s "${file}" ] - then - echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" - exit -1 - fi -done - -ln -sf ${DATAIN}/fixed/*.TBL ${SCRIPTS} -ln -sf ${DATAIN}/fixed/*.GFS ${SCRIPTS} -ln -sf ${EXECS}/init_atmosphere_model ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${SCRIPTS} -ln -sf ${DATAIN}/fixed/x1.${RES}.grid.nc ${SCRIPTS} - -sed -e "s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ - ${DATAIN}/namelists/namelist.init_atmosphere.STATIC \ - > ${SCRIPTS}/namelist.init_atmosphere - -sed -e "s,#RES#,${RES},g" \ - ${DATAIN}/namelists/streams.init_atmosphere.STATIC \ - > ${SCRIPTS}/streams.init_atmosphere - - - -mkdir -p ${DATAOUT}/logs -rm -f ${SCRIPTS}/static.bash -cat << EOF0 > ${SCRIPTS}/static.bash -#!/bin/bash -#SBATCH --job-name=${STATIC_jobname} -#SBATCH --nodes=${STATIC_nnodes} -#SBATCH --ntasks=${STATIC_ncores} -#SBATCH --tasks-per-node=${STATIC_ncpn} -#SBATCH --partition=${STATIC_QUEUE} -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/logs/static.bash.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/logs/static.bash.e%j # File name for standard error output -#SBATCH --exclusive -##SBATCH --mem=500000 - - -executable=init_atmosphere_model - -ulimit -s unlimited -ulimit -c unlimited -ulimit -v unlimited - -. $(pwd)/setenv.bash - -cd ${SCRIPTS} - -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} -date - -grep "Finished running" log.init_atmosphere.0000.out >& /dev/null -if [ \$? -ne 0 ]; then - echo " BUMMER: Static generation failed for some yet unknown reason." - echo " " - tail -10 ${STATICPATH}/log.init_atmosphere.0000.out - echo " " - exit 21 -fi - -echo " ####################################" -echo " ### Static completed - \$(date) ####" -echo " ####################################" -echo " " - -# -# clean up and remove links -# - -mv log.init_atmosphere.0000.out ${DATAOUT}/logs/log.init_atmosphere.0000.x1.${RES}.static.nc.out - - -EOF0 -chmod a+x ${SCRIPTS}/static.bash - - -echo -e "${GREEN}==>${NC} Executing sbatch static.bash...\n" -cd ${SCRIPTS} -sbatch --wait ${SCRIPTS}/static.bash -mv ${SCRIPTS}/static.bash ${DATAOUT}/logs/ - -if [ -s ${SCRIPTS}/x1.${RES}.static.nc ] -then - mv ${SCRIPTS}/x1.${RES}.static.nc ${DATAIN}/fixed -else - echo -e "${RED}==>${NC} File ${SCRIPTS}/x1.${RES}.static.nc was not created. \n" - exit -1 -fi - -find ${SCRIPTS} -maxdepth 1 -type l -exec rm -f {} \; -rm -f ${SCRIPTS}/log.init_atmosphere.* -rm -f ${SCRIPTS}/streams.init_atmosphere -rm -f ${SCRIPTS}/namelist.init_atmosphere - diff --git a/scripts.sdumont2/requirements.txt b/scripts.sdumont2/requirements.txt deleted file mode 100755 index 98aff53..0000000 --- a/scripts.sdumont2/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -netCDF4==1.6.5 -numpy==1.26.4 diff --git a/scripts.sdumont2/run_past2now.bash b/scripts.sdumont2/run_past2now.bash deleted file mode 100755 index 302362c..0000000 --- a/scripts.sdumont2/run_past2now.bash +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - - - -yyyymmddi=20241001 -yyyymmddf=20241007 -yyyymmdd=${yyyymmddi} - - -while [ ${yyyymmdd} -le ${yyyymmddf} ] -do - - echo "2.pre_processing.bash GFS 1024002 ${yyyymmdd}00 24" - - 2.pre_processing.bash GFS 1024002 ${yyyymmdd}00 24 - - yyyymmdd=$(date -u +%Y%m%d -d "${yyyymmdd} 1 day") -done diff --git a/scripts.sdumont2/setenv.bash b/scripts.sdumont2/setenv.bash deleted file mode 100755 index b430e02..0000000 --- a/scripts.sdumont2/setenv.bash +++ /dev/null @@ -1,183 +0,0 @@ -#!/bin/bash - -# Load modules: - -module use /scratch/cptec/pub/modulefiles -module load monan/monan-nvhpc-24.9 -module list - - -# Set environment variables and importants directories-------------------------------------------------- - - -# MONAN-suite install root directories: -# Put your directories: -export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) -export DIR_DADOS=$(dirname $(dirname $(pwd))) -export MONANDIR=/scratch/cptec/marcelo.ramos2/scripts_CD-CT/sources/MONAN-Model_feature/monan-631-GPU - -# Submiting variables: - -# PRE-Static phase: -export STATIC_QUEUE="lncc-h100" -export STATIC_ncores=32 -export STATIC_nnodes=1 -export STATIC_ncpn=32 -export STATIC_jobname="Pre.static" -export STATIC_walltime="02:00:00" - -# PRE-Degrib phase: -export DEGRIB_QUEUE="lncc-h100" -export DEGRIB_ncores=1 -export DEGRIB_nnodes=1 -export DEGRIB_ncpn=1 -export DEGRIB_jobname="Pre.degrib" -### export DEGRIB_walltime="00:30:00" not used yet - using STATIC_walltime - -# PRE-Init Atmosphere phase: -export INITATMOS_QUEUE="lncc-h100" -export INITATMOS_ncores=64 -export INITATMOS_nnodes=1 -### export INITATMOS_ncpn=1 not used yet - using INITATMOS_ncores -export INITATMOS_jobname="Pre.InitAtmos" -### export INITATMOS_walltime="01:00:00" not used yet - using STATIC_walltime - - -# Model phase: -export MODEL_QUEUE="lncc-h100" -export MODEL_ncores=192 -export MODEL_nnodes=2 -export MODEL_ncpn=96 -export MODEL_jobname="Model.MONAN" -export MODEL_walltime="2:00:00" - - -# Post phase: -export POST_QUEUE="lncc-h100" -### export POST_ncores=1 not used yet -export POST_nnodes=1 -export POST_ncpn=32 -export POST_jobname="Post.MONAN" -export POST_walltime="8:00:00" - - -# Products phase: -export PRODS_QUEUE="lncc-h100" -export PRODS_ncores=1 -export PRODS_nnodes=1 -export PRODS_ncpn=1 -export PRODS_jobname="Prods.MONAN" -export PRODS_walltime="8:00:00" - - -#----------------------------------------------------------------------- -# We discourage changing the variables below: - -# Others variables: -export OMP_NUM_THREADS=1 -export OMPI_MCA_btl_openib_allow_ib=1 -export OMPI_MCA_btl_openib_if_include="mlx5_0:1" -export PMIX_MCA_gds=hash -export MPI_PARAMS="-iface ib0 -bind-to core -map-by core" -#export MPI_PARAMS="-iface eno12399np0 -bind-to core -map-by core" -#export OMPI_MCA_coll_hcoll_enable=0 - -# Libraries paths: -#export NETCDF=/mnt/beegfs/monan/libs/netcdf -#export PNETCDF=/mnt/beegfs/monan/libs/PnetCDF -export NETCDFDIR=${NETCDF} -export PNETCDFDIR=${PNETCDF} -export DIRDADOS=/scratch/cptec/dados -export OPERDIR=/oper/dados/ioper/tempo - -# Colors: -export GREEN='\033[1;32m' # Green -export RED='\033[1;31m' # Red -export NC='\033[0m' # No Color -export BLUE='\033[01;34m' # Blue - - -# Functions: ====================================================================================================== - -how_many_nodes () { - nume=${1} - deno=${2} - num=$(echo "${nume}/${deno}" | bc -l) - how_many_nodes_int=$(echo "${num}/1" | bc) - dif=$(echo "scale=0; (${num}-${how_many_nodes_int})*100/1" | bc) - rest=$(echo "scale=0; (((${num}-${how_many_nodes_int})*${deno})+0.5)/1" | bc -l) - if [ ${dif} -eq 0 ]; then how_many_nodes_left=0; else how_many_nodes_left=1; fi - if [ ${how_many_nodes_int} -eq 0 ]; then how_many_nodes_int=1; how_many_nodes_left=0; rest=0; fi - how_many_nodes=$(echo "${how_many_nodes_int}+${how_many_nodes_left}" | bc ) - #echo "INT number of nodes needed: \${how_many_nodes_int} = ${how_many_nodes_int}" - #echo "number of nodes left: \${how_many_nodes_left} = ${how_many_nodes_left}" - echo "The number of nodes needed: \${how_many_nodes} = ${how_many_nodes}" - echo "" -} -#---------------------------------------------------------------------------------------------- - - - -clean_model_tmp_files () { - - echo "Removing all temporary files from last MODEL run trash." - - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/atmosphere_model - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*TBL - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*DBL - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*DATA - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.nc - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.graph.info.part.* - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/Vtable.GFS - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/streams.atmosphere - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stream_list.atmosphere.surface - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stream_list.atmosphere.output - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/stream_list.atmosphere.diagnostics - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/namelist.atmosphere - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/MONAN_DIAG_* - rm -f ${DIR_SCRIPTS}/scripts_CD-CT/scripts/log.atmosphere.* - echo "" - -} -#---------------------------------------------------------------------------------------------- - - -clean_post_tmp_files () { - - echo "Removing all temporary files from last POST run trash." - - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/dir.* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/PostAtmos_*.sh - - echo "" - -} -#---------------------------------------------------------------------------------------------- - - - -clean_pre_tmp_files () { - - echo "Removing all temporary files from last PRE run trash." - - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/log.*.0000.out - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.init.nc - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/GFS* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/init_atmosphere_model - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/namelist* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/streams.init_atmosphere - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.graph.info.part.* - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/x1.*.static.nc - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/ungrib.exe - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/Vtable - rm -fr ${DIR_SCRIPTS}/scripts_CD-CT/scripts/*.log - - - echo "" - -} -#---------------------------------------------------------------------------------------------- - - - - diff --git a/scripts.sdumont2/setenv_python.bash b/scripts.sdumont2/setenv_python.bash deleted file mode 100755 index 3e95168..0000000 --- a/scripts.sdumont2/setenv_python.bash +++ /dev/null @@ -1,17 +0,0 @@ -echo "loading module python ..." -#module load python-3.9.13-gcc-9.4.0-moxjnc6 - -echo "scripts folder setted=${SCRIPTS}" - -echo "creating python environment at ${SCRIPTS}/../.venv" -python3 -m venv ${SCRIPTS}/../.venv - -echo "activating python environment" -source ${SCRIPTS}/../.venv/bin/activate - -echo "Installing python libraries" -pip install --upgrade pip -pip install -r ${SCRIPTS}/requirements.txt - -export PYTHONPATH=${PYTHONPATH}:${SCRIPTS} -echo "exporting PYTHONPATH=${PYTHONPATH}" diff --git a/scripts.sdumont2/utils/install_libs_and_pio.bash b/scripts.sdumont2/utils/install_libs_and_pio.bash deleted file mode 100755 index f44da56..0000000 --- a/scripts.sdumont2/utils/install_libs_and_pio.bash +++ /dev/null @@ -1,352 +0,0 @@ -#! /bin/bash +x - -# conda deactivate - -. setenv_libs_and_pio.bash - -mkdir -p $YOUR_INSTALL_ROOT - -# -# Checking paths... -# -echo "event=$EDIR" -echo "hwloc=$HLDIR" -echo "zlib=$ZDIR" -echo "hdf5=$H5DIR" -echo "netcdf=$NFDIR" -echo "pnetcdf=$PNDIR" -echo "pio=$PIODIR" -echo "path=$PATH" - - -# -# Downloading all libs... -# - -echo "Downloading all libs, please wait and check all at the end!" - -mkdir -p $MY_LOCAL_DIR/src - -event_version=event-2.1.12 -echo " " -echo "Downloading event version $event_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz -tar xvfz libevent-2.1.12-stable.tar.gz -mv libevent-2.1.12-stable event_src - -hwloc_version=hwloc-2.5.0 -echo " " -echo "Downloading hwloc version $hwloc_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -wget https://download.open-mpi.org/release/hwloc/v2.5/hwloc-2.5.0.tar.gz -tar xvfz hwloc-2.5.0.tar.gz -mv hwloc-2.5.0 hwloc_src - -zlib_version=v1.3.1 -echo " " -echo "Downloading zlib version $zlib_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -git clone https://github.com/madler/zlib zlib_src -cd zlib_src -git checkout tags/$zlib_version -b branch_$zlib_version - -hdf5_version=hdf5-1_12_1 -echo " " -echo "Downloading hdf5 version $hdf5_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -git clone https://github.com/HDFGroup/hdf5 hdf5_src -cd hdf5_src -git checkout tags/$hdf5_version -b branch_$hdf5_version - -netcdf_c_version=v4.8.1 -echo " " -echo "Downloading netcdf-c version $netcdf_c_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -git clone http://github.com/Unidata/netcdf-c netcdf-c_src -cd netcdf-c_src -git checkout tags/${netcdf_c_version} -b branch_${netcdf_c_version} - -pnetcdf_version=checkpoint.1.12.2 -echo " " -echo "Downloading pnetcdf version $pnetcdf_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -git clone https://github.com/Parallel-NetCDF/PnetCDF PnetCDF_src -cd PnetCDF_src -git checkout tags/$pnetcdf_version -b branch_$pnetcdf_version - -netcdff_version=v4.5.4 -echo " " -echo "Downloading netcdf-fortran version $netcdff_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -git clone http://github.com/Unidata/netcdf-fortran netcdf-fortran_src -cd netcdf-fortran_src -git checkout tags/${netcdff_version} -b branch_${netcdff_version} - -#pio_version=pio1_7_1 -#pio_version=pio1_9_23 -pio_version=pio2_5_4 -echo " " -echo "Downloading pio version $pio_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -wget https://github.com/NCAR/ParallelIO/releases/download/pio2_5_4/pio-2.5.4.tar.gz -tar xvfz pio-2.5.4.tar.gz -#git clone https://github.com/NCAR/ParallelIO pio_src -#cd pio_src/pio -#git checkout tags/$pio_version -b branch_$pio_version - -wps_version=v4.5 -echo " " -echo "Downloading ungrib version $wps_version ... please wait" -echo " " -cd $MY_LOCAL_DIR/src -git clone https://github.com/wrf-model/WPS wps_src -cd wps_src -git checkout tags/$wps_version -b branch_$wps_version - - -cd $MY_LOCAL_DIR - - -# -# Installing libs... -# - - - -# -# EVENT -# - -echo " " -echo "Installing event version $event_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/event_src -cp -r $MY_LOCAL_DIR/src/event_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/event_src -mkdir -p ${EDIR} -./configure --prefix=${EDIR} -make -make install -cd $MY_LOCAL_DIR - -# -# HWLOC -# - -echo " " -echo "Installing hwloc version $hwloc_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/hwloc_src -cp -r $MY_LOCAL_DIR/src/hwloc_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/hwloc_src -mkdir -p ${HLDIR} -./configure --prefix=${HLDIR} -make check -make install -cd $MY_LOCAL_DIR - - -# -# ZLIB -# - -echo " " -echo "Installing zlib version $zlib_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/zlib_src -cp -r $MY_LOCAL_DIR/src/zlib_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/zlib_src -mkdir -p ${ZDIR} -./configure --prefix=${ZDIR} -make check -make install -cd $MY_LOCAL_DIR - - -# -# HDF5 -# - -echo " " -echo "Installing hdf5 version $hdf5_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/hdf5_src -cp -r $MY_LOCAL_DIR/src/hdf5_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/hdf5_src -mkdir -p ${H5DIR} -./configure --enable-parallel --enable-fortran --prefix=${H5DIR} --with-zlib=${ZDIR} -make -make install -cd $MY_LOCAL_DIR - - -# -# NETCDF-C -# - -echo " " -echo "Installing netcdf-c version $netcdf_c_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/netcdf-c_src -cp -r $MY_LOCAL_DIR/src/netcdf-c_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/netcdf-c_src -mkdir ${NFDIR} -CPPFLAGS="-I${H5DIR}/include -I$ZDIR/include" -LDFLAGS="-L${H5DIR}/lib -L$ZDIR/lib" -./configure --prefix=${NFDIR} --enable-netcdf4 --disable-hdf5 --disable-shared -make -make check -make install -cd $MY_LOCAL_DIR - - -# -# PNETCDF -# - -export LD_LIBRARY_PATH=${H5DIR}/lib:$ZDIR/lib:$NFDIR/lib:$HLDIR/lib:$EDIR/lib:${LD_LIBRARY_PATH} -#export LIBS="-lhwloc -levent_core -levent_pthreads" - -echo "ld_library_path=$LD_LIBRARY_PATH" -#echo "libs=$LIBS" - -echo " " -echo "Installing pnetcdf version $pnetcdf_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/PnetCDF_src -cp -r $MY_LOCAL_DIR/src/PnetCDF_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/PnetCDF_src -autoreconf -i -mkdir $PNDIR -#FC=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpif90 -#CC=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpicc -#CXX=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpicxx -#./configure --prefix=$PNDIR \ -# MPICC=mpicc MPICXX=mpicxx \ -# MPIF77=mpif77 MPIF90=mpif90 \ -# CC=gcc CXX=g++ F77=gfortran FC=gfortran -FC=mpif90 -CC=mpicc -CXX=mpicxx -./configure --prefix=$PNDIR -make -j8 -make install -cd $MY_LOCAL_DIR -# -# -# -# NETCDF-FORTRAN -# - -FC=mpif90 -CC=mpicc -#export CC=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpicc -#export FC=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpif90 -export CPPFLAGS="-I$H5DIR/include -I$ZDIR/include -I$NFDIR/include" -export LDFLAGS="-L$H5DIR/lib -L$ZDIR/lib -L$NFDIR/lib" -export LD_LIBRARY_PATH=${H5DIR}/lib:$ZDIR/lib:$NFDIR/lib:${LD_LIBRARY_PATH} -export LIBS="-lnetcdf -lhdf5_hl -lhdf5 -lz" - -echo "cc=$CC" -echo "fc=$FC" -echo "cppflags=$CPPFLAGS" -echo "ldflags=$LDFLAGS" -echo "ld_library_path=$LD_LIBRARY_PATH" -echo "libs=$LIBS" - -echo " " -echo "Installing netcdf-fortran version $netcdff_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/netcdf-fortran_src -cp -r $MY_LOCAL_DIR/src/netcdf-fortran_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/netcdf-fortran_src -./configure --disable-shared --prefix=${NCDIR} -make -make install -cd $MY_LOCAL_DIR - - -# -# PIO -# - -#export CC=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpicc -#export FC=/opt/ohpc/pub/mpi/openmpi4-gnu9/4.1.1/bin/mpif90 -#export CPPFLAGS="-I$PNDIR/include -I$NCDIR/include -I$NFDIR/include" -#export LDFLAGS="-L$PNDIR/lib -L$NCDIR/lib" -#export CFLAGS='-g -Wall' -#export CPPFLAGS="-I$H5DIR/include -I$ZDIR/include -I$NFDIR/include -I$PNDIR/include" -#export LDFLAGS="-L$H5DIR/lib -L$ZDIR/lib -L$NFDIR/lib -L$PNDIR/lib" -#export LD_LIBRARY_PATH=${H5DIR}/lib:$ZDIR/lib:$NFDIR/lib:$PNDIR/lib:${LD_LIBRARY_PATH} -#export LIBS="-lpnetcdf -lnetcdf -lhdf5_hl -lhdf5 -lz" -#export PNETCDF_PATH=$PNDIR -#export NETCDF_PATH=$NFDIR - -#export CPPFLAGS="-I/opt/mpi/openmpi/4.1.6.15.1/fortran-gnu/include -I/opt/mpi/openmpi/4.1.6.15.1include" -#export LDFLAGS="-L/opt/mpi/openmpi/4.1.6.15.1/fortran-gnu/lib -L/opt/mpi/openmpi/4.1.6.15.1/lib" -#export LD_LIBRAY_PATH=/opt/mpi/openmpi/4.1.6.15.1/fortran-gnu/lib:/opt/mpi/openmpi/4.1.6.15.1/lib:${LD_LIBRARY_PATH} - -FC=mpif90 -CC=mpicc - -echo " " -echo "Installing pio version $pio_version ... please wait" -echo " " -#autoreconf -i -#./configure --prefix=${PIODIR} --enable-fortran -#./configure --prefix=${PIODIR} -#./configure --prefix=${PIODIR} --enable-pnetcdf --enable-netcdf4 -#rm -rf $MY_LOCAL_DIR/lib/pio_src $PIODIR -#cp -r $MY_LOCAL_DIR/src/pio_src $MY_LOCAL_DIR/lib -#cd pio_src/pio -#rm -rf $MY_LOCAL_DIR/lib/pio-2.5.4.tar.gz $MY_LOCAL_DIR/lib/pio-2.5.4 $PIODIR -rm -rf $YOUR_INSTALL_ROOT/pio-2.5.4 $PIODIR -cp -r $MY_LOCAL_DIR/src/pio-2.5.4 $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/pio-2.5.4 -mkdir -p ${PIODIR} -#./configure --prefix=${PIODIR} --enable-fortran -cmake -DCMAKE_INSTALL_PREFIX=$PIODIR -Wno-dev -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -D NetCDF_C_PATH=$NCDIR -D NetCDF_Fortran_PATH=$NFDIR -D PnetCDF_PATH=$PNDIR -D PIO_ENABLE_EXAMPLES=OFF . -make check -make install -cd $MY_LOCAL_DIR - - -# -# WPS -# - -export NETCDF=$NFDIR -echo "NETCDF=$NETCDF" -#./configure --nowrf - -echo " " -echo "Installing ungrib version $wps_version ... please wait" -echo " " -rm -rf $YOUR_INSTALL_ROOT/wps_src -cp -r $MY_LOCAL_DIR/src/wps_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/wps_src -./configure --build-grib2-libs --nowrf -#./compile ungrib -#module load general/anaconda3/2024.10 -#source activate $HOME/conda-env/test-tf -#conda install conda-forge::tcsh -#ln -s /scratch/cptec/eduardo.khamis/conda-env/test-tf/bin/tcsh /scratch/cptec/eduardo.khamis/bin -tcsh ./compile ungrib -cd $MY_LOCAL_DIR - - - -# -# Moving/Copying libs... -# - -# Nothing here yet diff --git a/scripts.sdumont2/utils/install_ungrib.bash b/scripts.sdumont2/utils/install_ungrib.bash deleted file mode 100755 index 392dd09..0000000 --- a/scripts.sdumont2/utils/install_ungrib.bash +++ /dev/null @@ -1,81 +0,0 @@ -#! /bin/bash +x - -#module load general/anaconda3/2024.10 -#conda create --prefix $HOME/conda-env/test-tf python=3.12 -#source activate $HOME/conda-env/test-tf -#conda install conda-forge::tcsh -#ln -s /scratch/cptec/eduardo.khamis/conda-env/test-tf/bin/tcsh /scratch/cptec/eduardo.khamis/bin -#exit - -module purge -module load openmpi/gnu/4.1.6.15.1 -#module use /scratch/cptec/nvidia/x86_64/hpc_sdk/modulefiles/ -#module load nvhpc/23.1 -module list - -workdir=/scratch/cptec -#version=v0.23.1 -#spackdir=${workdir}/spack/${version} -#source ${spackdir}/share/spack/setup-env.sh -# -#export SPACK_USER_CONFIG_PATH=${workdir}/.spack/${version} -# -#export NETCDF=$(spack location -i netcdf-fortran) -#export PNETCDF=$(spack location -i parallel-netcdf) - -export NETCDF=/scratch/cptec/eduardo.khamis/libs_openmpi.ok/netcdf -export PNETCDF=/scratch/cptec/eduardo.khamis/libs_openmpi.ok/PnetCDF - -export PATH=${PATH}:$NETCDF/lib -export PATH=${PATH}:$NETCDF/include -export PATH=${PATH}:$PNETCDF/lib -export PATH=${PATH}:$PNETCDF/include - -export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$LD_LIBRARY_PATH - - -export MY_LOCAL_DIR=$(pwd) -export YOUR_INSTALL_ROOT=${workdir}/eduardo.khamis/ungrib - -export FC=mpif90 -export CC=mpicc -export CXX=mpicxx - -mkdir -p $MY_LOCAL_DIR/src -mkdir -p $YOUR_INSTALL_ROOT - -# -# WPS -# - -wps_version=v4.5 - -echo " " -echo "Downloading ungrib version $wps_version ... please wait" -echo " " - -#cd $MY_LOCAL_DIR/src -#rm -rf wps_src -#git clone https://github.com/wrf-model/WPS wps_src -#cd wps_src -#git checkout tags/$wps_version -b branch_$wps_version - -echo " " -echo "Installing ungrib version $wps_version ... please wait" -echo " " - -echo "netcdf=$NETCDF" -echo "path=$PATH" - -rm -rf $YOUR_INSTALL_ROOT/wps_src -cp -r $MY_LOCAL_DIR/src/wps_src $YOUR_INSTALL_ROOT -cd $YOUR_INSTALL_ROOT/wps_src -# escolher opcao 1 - gnu serial -./configure --build-grib2-libs --nowrf -#./configure --nowrf --build-grib2-libs -#./configure --nowrf -tcsh ./compile ungrib -cp -f $YOUR_INSTALL_ROOT/wps_src/ungrib/src/ungrib.exe $YOUR_INSTALL_ROOT -cd $MY_LOCAL_DIR - - diff --git a/scripts.sdumont2/utils/setenv_libs_and_pio.bash b/scripts.sdumont2/utils/setenv_libs_and_pio.bash deleted file mode 100755 index 1e75526..0000000 --- a/scripts.sdumont2/utils/setenv_libs_and_pio.bash +++ /dev/null @@ -1,39 +0,0 @@ -#! /bin/bash -x - -module purge -#module load ohpc -#module load cmake/3.21.3 -#module load cmake-3.24.2-gcc-9.4.0-s7wmakm -module load openmpi/gnu/4.1.6.15.1 -module list - -export MY_LOCAL_DIR=$(pwd) -export YOUR_INSTALL_ROOT=/scratch/cptec/eduardo.khamis/libs_openmpi - -export EDIR=${YOUR_INSTALL_ROOT}/event -export HLDIR=${YOUR_INSTALL_ROOT}/hwloc -export ZDIR=${YOUR_INSTALL_ROOT}/zlib -export H5DIR=${YOUR_INSTALL_ROOT}/hdf5 -export NFDIR=${YOUR_INSTALL_ROOT}/netcdf -export NCDIR=${NFDIR} -export PNDIR=${YOUR_INSTALL_ROOT}/PnetCDF -export PIODIR=${YOUR_INSTALL_ROOT}/pio - -export PATH=${PATH}:$EDIR/lib -export PATH=${PATH}:$EDIR/include -export PATH=${PATH}:$HLDIR/lib -export PATH=${PATH}:$HLDIR/include -export PATH=${PATH}:$ZDIR/lib -export PATH=${PATH}:$ZDIR/include -export PATH=${PATH}:$H5DIR/lib -export PATH=${PATH}:$H5DIR/include -export PATH=${PATH}:$NFDIR/bin -export PATH=${PATH}:$NFDIR/lib -export PATH=${PATH}:$NFDIR/include -export PATH=${PATH}:$PNDIR/lib -export PATH=${PATH}:$PNDIR/include -export PATH=${PATH}:$PIODIR/lib -export PATH=${PATH}:$PIODIR/include -export PATH=${PATH}:/usr/lib64/ - -ulimit -s unlimited diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 1e619e8..c6a169e 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -37,32 +37,28 @@ EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} #---------------------------------------------------------------------- - # Input variables:----------------------------------------------------- github_link="https://github.com/monanadmin/MONAN-Model.git" -monan_branch=feature/monan-833-NF +monan_branch=1.4.3-rc convertmpas_branch=1.2.0 EXP=GFS -RES=1024002 -YYYYMMDDHHi=2025101900 -FCST=240 +RES=1024002 #Options: 40962=120km;163842=60km;655362=30Km;1024002=24km;2621442=15Km;5898242=10Km +YYYYMMDDHHi=2026012000 +FCST=24 #---------------------------------------------------------------------- - # STEP 1: Installing and compiling the A-MONAN model and utility programs: #time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} #exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: -#time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} +time ${SCRIPTS}/2.pre_processing.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} #exit # STEP 3: Executing the Model run: time ${SCRIPTS}/3.run_model.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} -exit +#exit # STEP 4: Executing the Post of Model run: time ${SCRIPTS}/4.run_post.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} - - -exit +#exit diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index 9ea5b7a..a797ca1 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -88,11 +88,11 @@ EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} # Input variables:----------------------------------------------------- github_link_MONAN=${1}; #github_link=https://github.com/monanadmin/MONAN-Model.git tag_or_branch_name_MONAN=${2} -tag_or_branch_name_MONAN=${tag_or_branch_name_MONAN:="release/1.3.1-rc"} +tag_or_branch_name_MONAN=${tag_or_branch_name_MONAN:="1.4.3-rc"} echo "MONAN branch name in use: ${tag_or_branch_name_MONAN}" tag_or_branch_name_CONVERT_MPAS=${3} -tag_or_branch_name_CONVERT_MPAS=${tag_or_branch_name_CONVERT_MPAS:="1.1.0"} +tag_or_branch_name_CONVERT_MPAS=${tag_or_branch_name_CONVERT_MPAS:="1.2.0"} echo "convert_mpas branch name in use: ${tag_or_branch_name_CONVERT_MPAS}" #---------------------------------------------------------------------- diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 8aad1e7..0165d95 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -97,13 +97,15 @@ elif [ $RES -eq 2621442 ]; then #15Km CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 40962 ]; then #120Km CONFIG_DT=600.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 163842 ]; then #60Km CONFIG_DT=300.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 655362 ]; then #30Km CONFIG_DT=150.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 5898242 ]; then #10Km CONFIG_DT=60.0 - CONFIG_LEN_DISP=10000.0 CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 65536002 ]; then #3Km CONFIG_DT=18.0 @@ -205,14 +207,14 @@ ulimit -s unlimited cd ${DIRRUN} . ${SCRIPTS}/setenv.bash -export FI_CXI_RX_MATCH_MODE=hybrid - date beg_secs=\`date +"%s"\` if [ "$HOSTNAME" = "egeon" ]; then + echo "-- SLURM_JOB_ID: \$SLURM_JOB_ID" time mpirun -np ${MODEL_ncores} ./\${executable} else + echo "-- PBS_JOBID: \$PBS_JOBID" time mpirun --ppn ${MODEL_ncpn} -np ${MODEL_ncores} --depth=${MODEL_nthreads} --cpu-bind depth ./\${executable} fi diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index de32685..822c183 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -145,8 +145,10 @@ date beg_secs=\`date +"%s"\` if [ "$HOSTNAME" = "egeon" ]; then + echo "-- SLURM_JOB_ID: \$SLURM_JOB_ID" time mpirun -np ${INITATMOS_ncores} ./\${executable} else + echo "-- PBS_JOBID: \$PBS_JOBID" time mpirun --ppn ${INITATMOS_ncpn} -np ${INITATMOS_ncores} --depth=${INITATMOS_nthreads} --cpu-bind depth ./\${executable} fi diff --git a/scripts/make_static.bash b/scripts/make_static.bash index e7a59e3..82f079f 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -146,8 +146,10 @@ date beg_secs=\`date +"%s"\` if [ "$HOSTNAME" = "egeon" ]; then + echo "-- SLURM_JOB_ID: \$SLURM_JOB_ID" time mpirun -np ${STATIC_ncores} ./\${executable} else + echo "-- PBS_JOBID: \$PBS_JOBID" time mpirun --ppn ${STATIC_ncpn} -np ${STATIC_ncores} --depth=${STATIC_nthreads} --cpu-bind depth ./\${executable} fi diff --git a/scripts/namelists/namelist.atmosphere.TEMPLATE b/scripts/namelists/namelist.atmosphere.TEMPLATE index bab5a89..72952b9 100755 --- a/scripts/namelists/namelist.atmosphere.TEMPLATE +++ b/scripts/namelists/namelist.atmosphere.TEMPLATE @@ -62,7 +62,7 @@ config_radtsw_interval = '00:30:00' config_conv_interval = '#CONFIG_CONV_INTERVAL#' config_bucket_update = 'none' - config_physics_suite = 'convection_permitting_monan' + config_physics_suite = 'mesoscale_reference_monan' config_mynn_edmf = 0 / &gf_monan diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 7e680d0..3452832 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,9 +1,9 @@ #!/bin/bash umask 022 -# Choose your compiler here: -#export COMPILER=intel -export COMPILER=gnu +# Choose your compiler here (only on Jaci; on Egeon the compiler is fixed to ‘gnu’): +export COMPILER=intel +#export COMPILER=gnu #export COMPILER=cray #export COMPILER=nvidia @@ -30,6 +30,7 @@ case ${THOSTNAME} in export HOSTNAME="egeon" export MAKE_TARG=gfortran export MAKE_TARG2=gfortran + COMPILER=gnu ;; ian[0-9]*|cn-0[0-9][0-9][0-9]) export HOSTNAME="ian" @@ -58,7 +59,7 @@ export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=${DIR_SCRIPTS} -export MONANDIR=/lustre/projetos/monan_adm/eduardo.khamis/issues/854/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export MONANDIR=$MONANDIR # Load your system setenv: @@ -74,11 +75,6 @@ export MONANDIR=/lustre/projetos/monan_adm/eduardo.khamis/issues/854/scripts_CD- # We discourage changing the variables below: # Others variables: -export OMP_NUM_THREADS=1 -export OMPI_MCA_btl_openib_allow_ib=1 -export OMPI_MCA_btl_openib_if_include="mlx5_0:1" -export PMIX_MCA_gds=hash -export MPI_PARAMS="-iface ib0 -bind-to core -map-by core" # Colors: diff --git a/scripts/stools/setenv_PBS_ian_gnu.bash b/scripts/stools/setenv_PBS_ian_gnu.bash index 7b44fff..196318b 100755 --- a/scripts/stools/setenv_PBS_ian_gnu.bash +++ b/scripts/stools/setenv_PBS_ian_gnu.bash @@ -4,6 +4,9 @@ module purge module load PrgEnv-gnu module load craype-x86-turin +module load cray-hdf5/1.14.3.3 +module load cray-netcdf/4.9.0.15 +module load cray-parallel-netcdf/1.12.3.15 module load xpmem/0.2.119-1.3_gef379be13330 module load grads/2.2.1.oga.1 module load cdo/2.4.2 @@ -47,8 +50,8 @@ export INITATMOS_walltime="02:00:00" # Model phase: export MODEL_QUEUE="pesqextra" -export MODEL_ncores=8192 -export MODEL_nnodes=32 +export MODEL_ncores=2048 +export MODEL_nnodes=8 export MODEL_ncpus=256 export MODEL_ncpn=256 export MODEL_nthreads=1 @@ -69,25 +72,30 @@ export POST_walltime="8:00:00" # Libraries paths: -#export PIO=${PIO_ROOT} -#export NETCDF=${NETCDF_DIR} -#export PNETCDF=${PNETCDF_DIR} -export PIO=/lustre/projetos/monan_adm/eduardo.khamis/libs_gnu/source/installLibs -export NETCDF=/lustre/projetos/monan_adm/eduardo.khamis/libs_gnu/source/installLibs -export PNETCDF=/lustre/projetos/monan_adm/eduardo.khamis/libs_gnu/source/installLibs -export PIODIR=${PIO} +export NETCDF=${NETCDF_DIR} +export PNETCDF=${PNETCDF_DIR} export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} - export OPERDIR=/oper/dados/ioper/tempo -export DIRDADOS=/lustre/projetos/monan_adm/monan/dados/MONAN_v1.4.x -export GCCCIS=/lustre/projetos/monan_adm/monan/CIs +export DIRDADOS=/p/projetos/monan_adm/monan/dados/MONAN_v1.4.x +export GCCCIS=/p/projetos/monan_adm/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL -#export PIO= -export LD_LIBRARY_PATH=$NETCDF/lib64:$PNETCDF/lib64:$PIO/lib64:$LD_LIBRARY_PATH +export PIO= +export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib64:$LD_LIBRARY_PATH + + +# --- Others Variables --- +# HPE Slingshot/Libfabric: +export FI_CXI_REQ_BUF_SIZE=25165824 +export FI_CXI_RX_MATCH_MODE=software +export FI_MR_CACHE_MAX_COUNT=0 +# MPICH: +export MPICH_MEMORY_REPORT=2 +# OpenMP: +export OMP_NUM_THREADS=1 # diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index ae5e6f9..63211d8 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -7,6 +7,7 @@ module load craype-x86-turin module load cray-hdf5/1.14.3.3 module load cray-netcdf/4.9.0.15 module load cray-parallel-netcdf/1.12.3.15 +module load xpmem/0.2.119-1.3_gef379be13330 module load grads/2.2.1.oga.1 module load cdo/2.4.2 module load METIS/5.1.0 @@ -51,8 +52,8 @@ export INITATMOS_walltime="02:00:00" # Model phase: export MODEL_QUEUE="pesqextra" -export MODEL_ncores=8192 -export MODEL_nnodes=32 +export MODEL_ncores=2048 +export MODEL_nnodes=8 export MODEL_ncpus=256 export MODEL_ncpn=256 export MODEL_nthreads=1 @@ -78,18 +79,25 @@ export PNETCDF=${PNETCDF_DIR} export NETCDFDIR=${NETCDF} export PNETCDFDIR=${PNETCDF} - - - - export OPERDIR=/oper/dados/ioper/tempo -export DIRDADOS=/lustre/projetos/monan_adm/monan/dados/MONAN_v1.4.x -export GCCCIS=/lustre/projetos/monan_adm/monan/CIs +export DIRDADOS=/p/projetos/monan_adm/monan/dados/MONAN_v1.4.x +export GCCCIS=/p/projetos/monan_adm/monan/CIs # PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL export PIO= -export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib64:$LD_LIBRARY_PATH + + +# --- Others Variables --- +# HPE Slingshot/Libfabric: +export FI_CXI_REQ_BUF_SIZE=25165824 +export FI_CXI_RX_MATCH_MODE=software +export FI_MR_CACHE_MAX_COUNT=0 +# MPICH: +export MPICH_MEMORY_REPORT=2 +# OpenMP: +export OMP_NUM_THREADS=1 # diff --git a/scripts/stools/setenv_SLURM_egeon_gnu.bash b/scripts/stools/setenv_SLURM_egeon_gnu.bash index e666e8a..5efd038 100755 --- a/scripts/stools/setenv_SLURM_egeon_gnu.bash +++ b/scripts/stools/setenv_SLURM_egeon_gnu.bash @@ -71,3 +71,16 @@ export PNETCDFDIR=${PNETCDF} export DIRDADOS=/mnt/beegfs/monan/dados/MONAN_v1.4.x export OPERDIR=/oper/dados/ioper/tempo export GCCCIS=/mnt/beegfs/monan/CIs + + +# --- Others Vabriables --- +# OpenMPI: +export OMPI_MCA_btl_openib_allow_ib=1 +export OMPI_MCA_btl_openib_if_include="mlx5_0:1" +# PMIx (process management for MPI): +export PMIX_MCA_gds=hash +# MPI: +export MPI_PARAMS="-iface ib0 -bind-to core -map-by core" +# OpenMP: +export OMP_NUM_THREADS=1 + From ca7ae602fe9c6fb577536e8c6f5aea1db22577c0 Mon Sep 17 00:00:00 2001 From: Joao Silva Date: Thu, 22 Jan 2026 13:23:58 -0300 Subject: [PATCH 52/72] updated 0.run_all.bash to open the 1.install line by default --- scripts/0.run_all.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index c6a169e..4fa50e4 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -48,7 +48,7 @@ FCST=24 #---------------------------------------------------------------------- # STEP 1: Installing and compiling the A-MONAN model and utility programs: -#time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} +time ${SCRIPTS}/1.install_monan.bash ${github_link} ${monan_branch} ${convertmpas_branch} #exit # STEP 2: Executing the pre-processing fase. Preparing all CI/CC files needed: From b8afe34b091bec01521d8b3cb24fbaf114db63e8 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Fri, 27 Feb 2026 14:11:12 +0000 Subject: [PATCH 53/72] issue922 MPICH REPORT commented --- scripts/stools/setenv_PBS_ian_intel.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index 63211d8..22a7c5e 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -95,7 +95,7 @@ export FI_CXI_REQ_BUF_SIZE=25165824 export FI_CXI_RX_MATCH_MODE=software export FI_MR_CACHE_MAX_COUNT=0 # MPICH: -export MPICH_MEMORY_REPORT=2 +# export MPICH_MEMORY_REPORT=2 # OpenMP: export OMP_NUM_THREADS=1 From 6f8359c1bceaf1621c23a43568c786b2c29fc3fa Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Mon, 2 Mar 2026 19:03:46 +0000 Subject: [PATCH 54/72] issue-922: rename model.bash.e/model.bash.o to model.bash.e.JOBID\model.bash.o.JOBID, adds read permission to model.bash.e.JOBID/model.bash.o.JOBID --- scripts/3.run_model.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 0165d95..a5713dc 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -282,4 +282,10 @@ do done +JOBID=$(sed -n '5p' ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o.${JOBID} +mv ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.o.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Model/logs/model.bash.e.${JOBID} + rm -fr ${DIRRUN} From b7588fc696c37b5984bd280fee1438b6ae04b523 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Mon, 2 Mar 2026 19:10:23 +0000 Subject: [PATCH 55/72] issue-922: Fix 'No such file or directory Error' --- scripts/make_static.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 82f079f..cd3c6b6 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -136,8 +136,7 @@ ulimit -s unlimited ulimit -c unlimited ulimit -v unlimited - -. ${SCRIPTS}/setenv.bash +#. ${SCRIPTS}/setenv.bash cd ${DIRRUN} chmod 755 * From 2f2bf2379ffc5fb9163b804c7ddb40dac605fbee Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Sat, 7 Mar 2026 11:00:00 +0000 Subject: [PATCH 56/72] issue-922: MPICH REPORT commented --- scripts/stools/setenv_PBS_ian_gnu.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stools/setenv_PBS_ian_gnu.bash b/scripts/stools/setenv_PBS_ian_gnu.bash index 196318b..a2cf615 100755 --- a/scripts/stools/setenv_PBS_ian_gnu.bash +++ b/scripts/stools/setenv_PBS_ian_gnu.bash @@ -93,7 +93,7 @@ export FI_CXI_REQ_BUF_SIZE=25165824 export FI_CXI_RX_MATCH_MODE=software export FI_MR_CACHE_MAX_COUNT=0 # MPICH: -export MPICH_MEMORY_REPORT=2 +# export MPICH_MEMORY_REPORT=2 # OpenMP: export OMP_NUM_THREADS=1 From 420421abdffe49644c8767b399845306984333ea Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Sat, 7 Mar 2026 19:51:05 +0000 Subject: [PATCH 57/72] rename degrib.e/degrib.o to degrib.e.JOBID/degrib.o.JOBID, adds read permission to degrib.e.JOBID/degrib.o.JOBID --- scripts/make_degrib.bash | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/make_degrib.bash b/scripts/make_degrib.bash index 8d7bd11..43f7ca3 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib.bash @@ -148,6 +148,8 @@ cd ${DIRRUN} . ${SCRIPTS}/setenv.bash +echo "-- PBS_JOBID: \$PBS_JOBID" + ldd ungrib.exe rm -f GRIBFILE.* namelist.wps @@ -229,4 +231,11 @@ done mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* + +JOBID=$(sed -n '4p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o.${JOBID} +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e.${JOBID} + rm -fr ${DIRRUN} From 37271c6f9e56565e89b8f4184c516e7f5362e342 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Sat, 7 Mar 2026 19:53:23 +0000 Subject: [PATCH 58/72] rename initatmos.e/initatmos.bash.o to initatmos.bash.e.JOBID/initatmos.bash.o.JOBID, adds read permission to initatmos.bash.e.JOBID/initatmos.bash.o.JOBID --- scripts/make_initatmos.bash | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 822c183..186a8e7 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -186,6 +186,11 @@ case "${SCHEDULER_SYSTEM}" in esac mv ${DIRRUN}/initatmos.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +JOBID=$(sed -n '5p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o.${JOBID} +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.o.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/initatmos.bash.e.${JOBID} if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ] From cc4f4ee3effe9d24a9c9cc99f2e1caf52d035a44 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Sat, 7 Mar 2026 19:55:17 +0000 Subject: [PATCH 59/72] rename static.e/static.bash.o to static.bash.e.JOBID/static.bash.o.JOBID, adds read permission to static.bash.e.JOBID/static.bash.o.JOBID --- scripts/make_static.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/make_static.bash b/scripts/make_static.bash index cd3c6b6..9f75125 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -212,5 +212,11 @@ else exit -1 fi +JOBID=$(sed -n '2p' ${DATAOUT}/logs/static.bash.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/logs/static.bash.o ${DATAOUT}/logs/static.bash.o.${JOBID} +mv ${DATAOUT}/logs/static.bash.e ${DATAOUT}/logs/static.bash.e.${JOBID} +chmod a+r ${DATAOUT}/logs/static.bash.o.${JOBID} +chmod a+r ${DATAOUT}/logs/static.bash.e.${JOBID} + rm -fr ${DIRRUN} From 00c6b2d6d8334e76634ed4526f4e5d89d37512c3 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Sat, 7 Mar 2026 19:58:07 +0000 Subject: [PATCH 60/72] rename PostAtmos_node.X.e/PostAtmos_node.X.o to PostAtmos_node.X.e.JOBID/PostAtmos_node.X.o.JOBID, adds read permission to PostAtmos_node.X.e.JOBID/PostAtmos_node.X.o.JOBID --- scripts/4.run_post.bash | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index a65efb8..f6b082b 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -218,6 +218,8 @@ cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh cd ${DIRRUN} . ${SCRIPTS}/setenv.bash +echo "-- PBS_JOBID: \$PBS_JOBID" + chmod 755 ${DIRRUN}/* echo "Executing posts ${inicio} to ${fim} in node Node ${node}." @@ -301,7 +303,7 @@ EOSH sleep 5 done - +total_nodes=${node} # Dependencias JobId: dependency="afterok" @@ -315,6 +317,7 @@ done node=0 rm -f ${DIRRUN}/PostAtmos_node.${node}.sh + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then sed -e "s,#JOBNAME#,MO.Pos${node},g; @@ -337,6 +340,7 @@ cat << EOSH >> ${DIRRUN}/PostAtmos_node.${node}.sh cd ${DIRRUN} . ${SCRIPTS}/setenv.bash +echo "-- PBS_JOBID: \$PBS_JOBID" # Saving important files to the logs directory: cp -f ${EXECS}/CONVMPAS-VERSION.txt ${DATAOUT}/${YYYYMMDDHHi}/Post @@ -380,3 +384,13 @@ esac cd ${SCRIPTS} chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Post/* time ${SCRIPTS}/make_template.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} + +for ((n=0 ; n Date: Tue, 10 Mar 2026 15:41:57 +0000 Subject: [PATCH 61/72] Added support for Cray XD2000 compiler --- scripts/stools/setenv_PBS_ian_cray.bash | 132 ++++++++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100755 scripts/stools/setenv_PBS_ian_cray.bash diff --git a/scripts/stools/setenv_PBS_ian_cray.bash b/scripts/stools/setenv_PBS_ian_cray.bash new file mode 100755 index 0000000..6510afd --- /dev/null +++ b/scripts/stools/setenv_PBS_ian_cray.bash @@ -0,0 +1,132 @@ +#!/bin/bash + +# Load modules: +module purge +module load PrgEnv-cray +module load craype-x86-turin +module load cray-hdf5/1.14.3.3 +module load cray-netcdf/4.9.0.15 +module load cray-parallel-netcdf/1.12.3.15 +module load xpmem/0.2.119-1.3_gef379be13330 +module load grads/2.2.1.oga.1 +module load cdo/2.4.2 +module load METIS/5.1.0 +module load cray-pals +module list + + +# Submiting variables: + +# PRE-Static phase: +export STATIC_QUEUE="pesqextra" +export STATIC_ncores=128 +export STATIC_nnodes=4 +export STATIC_ncpus=32 +export STATIC_ncpn=32 +export STATIC_nthreads=1 +export STATIC_jobname="Pre.static" +export STATIC_walltime="02:00:00" + + +# PRE-Degrib phase: +export DEGRIB_QUEUE="pesqextra" +export DEGRIB_ncores=1 +export DEGRIB_nnodes=1 +export DEGRIB_ncpus=1 +export DEGRIB_ncpn=1 +export DEGRIB_nthreads=1 +export DEGRIB_jobname="Pre.degrib" +export DEGRIB_walltime="02:00:00" + +# PRE-Init Atmosphere phase: +export INITATMOS_QUEUE="pesqextra" +export INITATMOS_ncores=512 +export INITATMOS_nnodes=4 +export INITATMOS_ncpus=128 +export INITATMOS_ncpn=128 +export INITATMOS_nthreads=1 +export INITATMOS_jobname="Pre.InitAtmos" +export INITATMOS_walltime="02:00:00" + +# Model phase: +export MODEL_QUEUE="pesqextra" +export MODEL_ncores=2048 +export MODEL_nnodes=8 +export MODEL_ncpus=256 +export MODEL_ncpn=256 +export MODEL_nthreads=1 +export MODEL_jobname="Model.MONAN" +export MODEL_walltime="8:00:00" +#PBS -l select=8:ncpus=64:mpiprocs=64 == 512mpi, 8nodes, 64cpn +#PBS -l select=16:ncpus=64:mpiprocs=64 == 1024mpi, 16nodes, 64cpn + +# Post phase: +export POST_QUEUE="pesqextra" +export POST_ncores=32 +export POST_nnodes=1 +export POST_ncpus=32 +export POST_ncpn=32 +export POST_nthreads=1 +export POST_jobname="Post.MONAN" +export POST_walltime="8:00:00" + + +# Libraries paths: +export NETCDF=${NETCDF_DIR} +export PNETCDF=${PNETCDF_DIR} +export NETCDFDIR=${NETCDF} +export PNETCDFDIR=${PNETCDF} + +export OPERDIR=/oper/dados/ioper/tempo +export DIRDADOS=/p/projetos/monan_adm/monan/dados/MONAN_v1.4.x +export GCCCIS=/p/projetos/monan_adm/monan/CIs + + +# PIO is not necessary for version 8.* If PIO is empty, MPAS Will use SMIOL +export PIO= +export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib64:$LD_LIBRARY_PATH + +# --- Others Variables --- +# HPE Slingshot/Libfabric: +export FI_CXI_REQ_BUF_SIZE=25165824 +export FI_CXI_RX_MATCH_MODE=software +export FI_MR_CACHE_MAX_COUNT=0 +# MPICH: +export MPICH_MEMORY_REPORT=2 +# OpenMP: +export OMP_NUM_THREADS=1 + + +# +# -------- Tested Configurations --------- +# + +#export MODEL_ncores=8192 +#export MODEL_nnodes=32 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=7680 +#export MODEL_nnodes=30 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=1024 +#export MODEL_nnodes=16 +#export MODEL_ncpus=256 +#export MODEL_ncpn=64 +#export MODEL_nthreads=4 + +#export MODEL_ncores=4096 +#export MODEL_nnodes=20 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 + +#export MODEL_ncores=6144 +#export MODEL_nnodes=24 +#export MODEL_ncpus=256 +#export MODEL_ncpn=256 +#export MODEL_nthreads=1 From 7c24264fa85ad1254d4d0b3f46dc358b3823c1e1 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Tue, 10 Mar 2026 15:45:12 +0000 Subject: [PATCH 62/72] Added support for Cray XD2000 compiler --- scripts/setenv.bash | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 3452832..842820f 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -2,9 +2,9 @@ umask 022 # Choose your compiler here (only on Jaci; on Egeon the compiler is fixed to ‘gnu’): -export COMPILER=intel +#export COMPILER=intel #export COMPILER=gnu -#export COMPILER=cray +export COMPILER=cray #export COMPILER=nvidia # Squeduler detect: @@ -40,6 +40,9 @@ case ${THOSTNAME} in elif [ "$COMPILER" == "gnu" ]; then export MAKE_TARG=gfortran-xd2000 export MAKE_TARG2=gfortran-xd2000 + elif [ "$COMPILER" == "cray" ]; then + export MAKE_TARG=cray-xd2000 + export MAKE_TARG2=cray-xd2000 fi ;; esac @@ -59,7 +62,7 @@ export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=${DIR_SCRIPTS} -export MONANDIR=$MONANDIR +export MONANDIR=/p/projetos/monan_adm/daniel.massaru/issue922-teste/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF # Load your system setenv: From 7f753a76825e7fe0c1727c08e9211d24d5a03fd8 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Tue, 10 Mar 2026 17:31:33 +0000 Subject: [PATCH 63/72] issue-922: MPICH REPORT commented --- scripts/stools/setenv_PBS_ian_cray.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/stools/setenv_PBS_ian_cray.bash b/scripts/stools/setenv_PBS_ian_cray.bash index 6510afd..0280b15 100755 --- a/scripts/stools/setenv_PBS_ian_cray.bash +++ b/scripts/stools/setenv_PBS_ian_cray.bash @@ -92,7 +92,7 @@ export FI_CXI_REQ_BUF_SIZE=25165824 export FI_CXI_RX_MATCH_MODE=software export FI_MR_CACHE_MAX_COUNT=0 # MPICH: -export MPICH_MEMORY_REPORT=2 +# export MPICH_MEMORY_REPORT=2 # OpenMP: export OMP_NUM_THREADS=1 From 39a7ba8db479e84812e7d1a3bc5bf9b69a1a1932 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Tue, 10 Mar 2026 17:38:14 +0000 Subject: [PATCH 64/72] Setting the intel compiler as default --- scripts/setenv.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 842820f..0346d3e 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -2,9 +2,9 @@ umask 022 # Choose your compiler here (only on Jaci; on Egeon the compiler is fixed to ‘gnu’): -#export COMPILER=intel +export COMPILER=intel #export COMPILER=gnu -export COMPILER=cray +#export COMPILER=cray #export COMPILER=nvidia # Squeduler detect: From c8af6f4a79519847b20140c2ab0620838b250d31 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Tue, 17 Mar 2026 11:30:50 +0000 Subject: [PATCH 65/72] issue-934: adds read permission to logs/log.init_atmosphere.* --- scripts/make_static.bash | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/make_static.bash b/scripts/make_static.bash index 9f75125..e38061a 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -202,7 +202,6 @@ mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/logs/ mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/logs/ mv log.init_atmosphere.* ${DATAOUT}/logs/ - if [ -s ${DIRRUN}/x1.${RES}.static.nc ] then mv ${DIRRUN}/x1.${RES}.static.nc ${DATAIN}/fixed @@ -217,6 +216,6 @@ mv ${DATAOUT}/logs/static.bash.o ${DATAOUT}/logs/static.bash.o.${JOBID} mv ${DATAOUT}/logs/static.bash.e ${DATAOUT}/logs/static.bash.e.${JOBID} chmod a+r ${DATAOUT}/logs/static.bash.o.${JOBID} chmod a+r ${DATAOUT}/logs/static.bash.e.${JOBID} - +chmod a+r ${DATAOUT}/logs/log.init_atmosphere.* rm -fr ${DIRRUN} From e24e90e7b6f8b346ca8471b8e8b18d4c015069d2 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Tue, 17 Mar 2026 11:38:27 +0000 Subject: [PATCH 66/72] issue-934: adjust config_smdiv to 0.15 --- scripts/namelists/namelist.atmosphere.TEMPLATE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/namelists/namelist.atmosphere.TEMPLATE b/scripts/namelists/namelist.atmosphere.TEMPLATE index 72952b9..d234253 100755 --- a/scripts/namelists/namelist.atmosphere.TEMPLATE +++ b/scripts/namelists/namelist.atmosphere.TEMPLATE @@ -27,7 +27,7 @@ config_monotonic = true config_coef_3rd_order = 0.25 config_epssm = 0.1 - config_smdiv = 0.1 + config_smdiv = 0.15 / &damping config_zd = 22000.0 From fd00cfbe4805506dfe2130d5d3855d8f472fe3a1 Mon Sep 17 00:00:00 2001 From: Daniel Massaru Date: Tue, 17 Mar 2026 12:00:17 +0000 Subject: [PATCH 67/72] issue-934: assign MONANDIR to itself --- scripts/setenv.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setenv.bash b/scripts/setenv.bash index 0346d3e..fa2f731 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -62,7 +62,7 @@ export SYSTEM_KEYC="${SCHEDULER_SYSTEM}_${HOSTNAME}_${COMPILER}" # Put your directories: export DIR_SCRIPTS=$(dirname $(dirname $(pwd))) export DIR_DADOS=${DIR_SCRIPTS} -export MONANDIR=/p/projetos/monan_adm/daniel.massaru/issue922-teste/scripts_CD-CT/sources/MONAN-Model_feature/monan-833-NF +export MONANDIR=$MONANDIR # Load your system setenv: From db4bcf4469813aee1aaaf8dd0ebc92c95e3f1924 Mon Sep 17 00:00:00 2001 From: Joao Silva Date: Fri, 12 Jun 2026 22:32:38 -0300 Subject: [PATCH 68/72] new features: regional mode and ERA5 --- README.md | 5 + scripts/2.pre_processing.bash | 72 +++-- scripts/3.run_model.bash | 59 ++-- scripts/4.run_post.bash | 37 ++- scripts/make_degrib_ERA5.bash | 275 ++++++++++++++++++ ...{make_degrib.bash => make_degrib_GFS.bash} | 144 +++++++-- scripts/make_initatmos.bash | 10 +- scripts/make_lbcs.bash | 188 ++++++++++++ scripts/make_template.bash | 49 +++- .../namelists/namelist.atmosphere.TEMPLATE | 2 +- .../namelists/namelist.init_atmosphere.LBCS | 48 +++ .../namelist.init_atmosphere.TEMPLATE | 3 +- scripts/namelists/namelist.wps.TEMPLATE | 4 +- scripts/namelists/streams.atmosphere.TEMPLATE | 7 + .../namelists/streams.init_atmosphere.LBCS | 20 ++ scripts/setenv.bash | 4 + scripts/stools/setenv_PBS_ian_intel.bash | 7 +- 17 files changed, 835 insertions(+), 99 deletions(-) create mode 100755 scripts/make_degrib_ERA5.bash rename scripts/{make_degrib.bash => make_degrib_GFS.bash} (62%) create mode 100755 scripts/make_lbcs.bash create mode 100755 scripts/namelists/namelist.init_atmosphere.LBCS create mode 100755 scripts/namelists/streams.init_atmosphere.LBCS diff --git a/README.md b/README.md index 9a984fc..c66cd8f 100755 --- a/README.md +++ b/README.md @@ -2,6 +2,11 @@ ## 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). diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index baba5e6..9cc8a0b 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -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 ERA5" 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)" @@ -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} @@ -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 @@ -95,31 +93,63 @@ then 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 == "ERA5" ]]; 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=ERA5.\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} == "ERA5" ]] +then + echo -e "${GREEN}==>${NC} Submitting Degrib for ERA5 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=ERA5.\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 == "ERA5" ]]; 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=ERA5.\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 +#---------------------------------------------------------------------------------- diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index a5713dc..7f5ae8c 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -8,10 +8,10 @@ umask 022 # # Performs the following tasks: # -# o VCheck all input files before -# o Creates the submition script +# o Check all input files before +# o Creates the submission script # o Submit the model -# o Veriffy all files generated +# o Verify all files generated # # #-----------------------------------------------------------------------------# @@ -23,7 +23,7 @@ then echo "" echo "${0} [EXP_NAME/OP] RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS" + echo "EXP_NAME :: Forcing: GFS or ERA5" echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." @@ -89,30 +89,49 @@ printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # From now on, CONFI_LEN_DISP becames cte = 0.0, pickin up this value from static file. # Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - CONFIG_DT=150.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 2621442 ]; then #15Km - CONFIG_DT=90.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 40962 ]; then #120Km +if [ $RES -eq 40962 ]; then #120Km CONFIG_DT=600.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 163842 ]; then #60Km +elif [ $RES -eq 163842 ]; then #60Km CONFIG_DT=300.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 655362 ]; then #30Km +elif [ $RES -eq 655362 ]; then #30Km CONFIG_DT=150.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [ $RES -eq 1024002 ]; then #24Km + CONFIG_DT=150.0 + CONFIG_CONV_INTERVAL="00:15:00" +elif [ $RES -eq 2621442 ]; then #15Km + CONFIG_DT=90.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 5898242 ]; then #10Km CONFIG_DT=60.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [ $RES -eq 23592962 ]; then #5km + CONFIG_DT=30.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 65536002 ]; then #3Km CONFIG_DT=18.0 CONFIG_CONV_INTERVAL="00:15:00" +else + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} [${0}] Simulation parameters for resolution $RES have not been set! Edit them in '3.run_model.bash'.\n" + exit -1 fi #------------------------------------------------------- +# Setting configuration to apply or not lateral boundary conditions +if [[ $MODERUN == "R" ]]; then + APPLY_LBCS=true +elif [[ $MODERUN == "G" ]]; then + APPLY_LBCS=false +else + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} Atmosphere phase fails! Please select MODERUN=R (Regional) or MODERUN=G (Global) in 'setenv.bash' so that MONAN knows whether to read or not lateral boundary conditions.\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 +fi +#------------------------------------------------------- # Calculating final forecast dates in model namelist format: DD_HH:MM:SS # using: start_date(yyyymmdd) + FCST(hh) : @@ -139,7 +158,7 @@ then fi -files_needed=("${SCRIPTS}/namelists/stream_list.atmosphere.output" ""${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} "${SCRIPTS}/namelists/stream_list.atmosphere.surface" "${EXECS}/atmosphere_model" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${DATAIN}/fixed/Vtable.GFS") +files_needed=("${SCRIPTS}/namelists/stream_list.atmosphere.output" ""${SCRIPTS}/namelists/stream_list.atmosphere.diagnostics${VARTABLE} "${SCRIPTS}/namelists/stream_list.atmosphere.surface" "${EXECS}/atmosphere_model" "${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${DATAIN}/fixed/Vtable.${EXP}") for file in "${files_needed[@]}" do if [ ! -s "${file}" ] @@ -157,16 +176,18 @@ cp -f ${DATAIN}/fixed/*DATA ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${DIRRUN} -cp -f ${DATAIN}/fixed/Vtable.GFS ${DIRRUN} +cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN} - -if [ ${EXP} = "GFS" ] +if [[ $MODERUN == "R" ]]; then + cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/lbc*.nc ${DIRRUN} +fi +if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" ]] then sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; -s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g" \ +s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g;s,#APPLY_LBCS#,${APPLY_LBCS},g" \ ${SCRIPTS}/namelists/namelist.atmosphere.TEMPLATE > ${DIRRUN}/namelist.atmosphere - sed -e "s,#RES#,${RES},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ + sed -e "s,#RES#,${RES},g;s,#LBCINT#,${LBCINT},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ ${SCRIPTS}/namelists/streams.atmosphere.TEMPLATE > ${DIRRUN}/streams.atmosphere fi cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index f6b082b..85eda74 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -88,21 +88,7 @@ IFS=":" read -r h m s <<< "${t_strout}" printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km - NLAT=721 #180/0.25 - NLON=1441 #360/0.25 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 2621442 ]; then #15Km - NLAT=1201 #180/0.15 - NLON=2401 #360/0.15 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 40962 ]; then #120Km +if [ $RES -eq 40962 ]; then #120Km NLAT=150 #180/1.2 NLON=300 #360/1.2 STARTLAT=-90.0 @@ -123,6 +109,20 @@ elif [ $RES -eq 655362 ]; then #30Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [ $RES -eq 1024002 ]; then #24Km + NLAT=721 #180/0.25 + NLON=1441 #360/0.25 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 2621442 ]; then #15Km + NLAT=1201 #180/0.15 + NLON=2401 #360/0.15 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 elif [ $RES -eq 5898242 ]; then #10Km NLAT=1801 #180/0.10 (+1) NLON=3601 #360/0.10 (+1) @@ -130,6 +130,13 @@ elif [ $RES -eq 5898242 ]; then #10Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [ $RES -eq 23592962 ]; then #5Km + NLAT=3601 #180/0.05 + NLON=7201 #360/0.05 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 elif [ $RES -eq 65536002 ]; then #3Km NLAT=6001 #180/0.03 NLON=12001 #360/0.03 diff --git a/scripts/make_degrib_ERA5.bash b/scripts/make_degrib_ERA5.bash new file mode 100755 index 0000000..37c8849 --- /dev/null +++ b/scripts/make_degrib_ERA5.bash @@ -0,0 +1,275 @@ +#!/bin/bash + +if [ $# -ne 6 ] +then + echo "" + echo "Instructions: execute the command below" + echo "" + echo "${0} EXP_NAME RESOLUTION LABELI FCST" + echo "" + echo "EXP_NAME :: Forcing: GFS" + echo " :: Others options to be added later..." + echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" + echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" + echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." + echo "" + echo "24 hour forecast example:" + echo "${0} GFS 1024002 2024010100 24" + echo "${0} GFS 40962 2024010100 48" + echo "" + + exit +fi + +# Set environment variables exports: +echo "" +echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" +. setenv.bash + + +# Standart 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} +DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} +DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} +SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} +EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} +#---------------------------------------------------------------------- + + +# Input variables:-------------------------------------- +EXP=${1}; #EXP=GFS +MESH=${2}; #MESH +YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 +FCST=${4}; #FCST=24 +REGIONAL=${5}; #REGIONAL=Y +LBCINT=${6}; #LBCINT=21600 +#------------------------------------------------------- + +source utils.bash + +# Local variables-------------------------------------- +start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 +YYYYMMDDHHf=$(add_hours "$YYYYMMDDHHi" "$FCST") +final_date=${YYYYMMDDHHf:0:4}-${YYYYMMDDHHf:4:2}-${YYYYMMDDHHf:6:2}_${YYYYMMDDHHf:8:2}:00:00 +## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +## !!!!!!!!!!! ATENCAO: AQUI ESTA SENDO ASSUMIDO QUE TODOS OS DADOS DO ERA5 NECESSARIOS PARA O !!!!!!!!!!! +## !!!!!!!!!!! EXPERIMENTO ESTAO NO SEGUINTE DIRETORIO: !!!!!!!!!!! +## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +ERA5_DATA=/pesq/share/monan/curso_OMM_INPE_2025/CGFD-USP_Cases/MPAS-BR/met_data/ERA5/DATA +## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +BNDDIR=${ERA5_DATA} +export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} +#------------------------------------------------------- +mkdir -p ${DATAIN}/${YYYYMMDDHHi} +mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs + +mkdir -p ${HOME}/local/lib64 +cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 +cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 + + +# Se nao existir CI no diretorio ERA5_data, aborta! +if [ ! -s ${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib ] || [ ! -s ${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib ] +then + echo -e "${RED}==>${NC}Condicao de contorno inexistente !" + echo -e "${RED}==>${NC}Check ${BNDDIR} or." + echo -e "${RED}==>${NC}Check ${GCCCIS}" + exit 1 +fi + +## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +## !!!!!!!!!!! ATENCAO: AQUI ESTA SENDO ASSUMIDO QUE A TABELA Vtable.ECMWF EXISTE NESSE DIRETORIO !!!!!!!! +## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +# Copiar Vtable do ERA5 +cp /pesq/share/monan/curso_OMM_INPE_2025/CGFD-USP_Cases/WPS/ungrib/Variable_Tables/Vtable.ECMWF ${DATAIN}/fixed +## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +files_needed=("${DATAIN}/fixed/${MESH}.static.nc" "${DATAIN}/fixed/Vtable.ECMWF" "${EXECS}/ungrib.exe" "${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib" "${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib") +for file in "${files_needed[@]}" +do + if [ ! -s "${file}" ] + then + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" + exit -1 + fi +done + +# Copia arquivos necessarios para diretorio DIRRUN +cp -f ${DATAIN}/fixed/${MESH}.static.nc ${DIRRUN} +cp -f ${DATAIN}/fixed/Vtable.ECMWF ${DIRRUN}/Vtable +cp -f ${EXECS}/ungrib.exe ${DIRRUN} +cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE + +cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} +rm -f ${DIRRUN}/degrib.bash + +if [[ $REGIONAL == "Y" ]]; then + echo "REGIONAL=Y. Degribbing ERA5 data for both initial and lateral boundary conditions..." + cp -f ${BNDDIR}/era5.pl.*.grib ${DATAIN}/${YYYYMMDDHHi} + cp -f ${BNDDIR}/era5.sl.*.grib ${DATAIN}/${YYYYMMDDHHi} + cat << EOF0 > ${DIRRUN}/degrib.bash +#!/bin/bash -x +#SBATCH --job-name=${DEGRIB_jobname} +#SBATCH --nodes=${DEGRIB_nnodes} +#SBATCH --partition=${DEGRIB_QUEUE} +#SBATCH --ntasks=${DEGRIB_ncores} +#SBATCH --tasks-per-node=${DEGRIB_ncpn} # ic for benchmark +#SBATCH --time=${STATIC_walltime} +#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o%j # File name for standard output +#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e%j # File name for standard error output +# + +ulimit -s unlimited +ulimit -c unlimited +ulimit -v unlimited + +export PMIX_MCA_gds=hash + + +export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 + +cd ${DIRRUN} +. setenv.bash + +ldd ungrib.exe + +rm -f GRIBFILE.* namelist.wps + + +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,ERA5,g" \ + ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps + +./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/era5.*.grib + +date +time mpirun -np 1 ./ungrib.exe +date + + +grep "Successful completion of program ungrib.exe" ${DIRRUN}/ungrib.log >& /dev/null + +if [ \$? -ne 0 ]; then + echo " BUMMER: Ungrib generation failed for some yet unknown reason." + echo " " + tail -10 ${DIRRUN}/ungrib.log + echo " " + exit 21 +fi + +# +# clean up and remove links +# + mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log + mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps + mv ERA5* ${DATAOUT}/${YYYYMMDDHHi}/Pre + + rm -fr ${DATAIN}/${YYYYMMDDHHi} + +echo "End of degrib Job" + + +EOF0 + + +elif [[ $REGIONAL == "N" ]]; then + echo "REGIONAL=N. Degribbing ERA5 data only for initial conditions..." + cp -f ${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib ${DATAIN}/${YYYYMMDDHHi} + cp -f ${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib ${DATAIN}/${YYYYMMDDHHi} + cat << EOF0 > ${DIRRUN}/degrib.bash +#!/bin/bash -x +#SBATCH --job-name=${DEGRIB_jobname} +#SBATCH --nodes=${DEGRIB_nnodes} +#SBATCH --partition=${DEGRIB_QUEUE} +#SBATCH --ntasks=${DEGRIB_ncores} +#SBATCH --tasks-per-node=${DEGRIB_ncpn} # ic for benchmark +#SBATCH --time=${STATIC_walltime} +#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o%j # File name for standard output +#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e%j # File name for standard error output +# + +ulimit -s unlimited +ulimit -c unlimited +ulimit -v unlimited + +export PMIX_MCA_gds=hash + + +export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 + +cd ${DIRRUN} +. setenv.bash + +ldd ungrib.exe + +rm -f GRIBFILE.* namelist.wps + + +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,ERA5,g" \ + ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps + +./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/era5.*.${YYYYMMDDHHi}.grib + +date +time mpirun -np 1 ./ungrib.exe +date + + +grep "Successful completion of program ungrib.exe" ${DIRRUN}/ungrib.log >& /dev/null + +if [ \$? -ne 0 ]; then + echo " BUMMER: Ungrib generation failed for some yet unknown reason." + echo " " + tail -10 ${DIRRUN}/ungrib.log + echo " " + exit 21 +fi + +# +# clean up and remove links +# + mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log + mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps + mv ERA5\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre + + rm -fr ${DATAIN}/${YYYYMMDDHHi} + +echo "End of degrib Job" + + +EOF0 + +else + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} LBCs phase fails during degrib! Please select REGIONAL=Y or REGIONAL=N so that degrib can be done appropriately.\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 +fi + + +chmod a+x ${DIRRUN}/degrib.bash + +echo -e "${GREEN}==>${NC} Executing sbatch degrib.bash...\n" +cd ${DIRRUN} +sbatch --wait ${DIRRUN}/degrib.bash + + + +files_ungrib=("${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}") +for file in "${files_ungrib[@]}" +do + if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Pre/${file} ] + then + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} Degrib fails! At least the file ${file} was not generated at ${DATAIN}/${YYYYMMDDHHi}. \n" + echo -e "${RED}==>${NC} Check logs at ${DATAOUT}/logs/degrib.* .\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 + fi +done + +mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +rm -fr ${DIRRUN} diff --git a/scripts/make_degrib.bash b/scripts/make_degrib_GFS.bash similarity index 62% rename from scripts/make_degrib.bash rename to scripts/make_degrib_GFS.bash index 43f7ca3..feb3243 100755 --- a/scripts/make_degrib.bash +++ b/scripts/make_degrib_GFS.bash @@ -15,7 +15,7 @@ then echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." echo "" - echo "24 hour forcast example:" + echo "24 hour forecast example:" echo "${0} GFS 1024002 2024010100 24" echo "${0} GFS 40962 2024010100 48" echo "" @@ -55,6 +55,10 @@ FCST=${4}; #FCST=24 # Local variables-------------------------------------- start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 +yyyymmddi=${YYYYMMDDHHi:0:8} +hhi=${YYYYMMDDHHi:8:2} +yyyymmddhhf=$(date +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${FCST} hours" ) +final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhhf:8:2}:00:00 export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} #------------------------------------------------------- mkdir -p ${DATAIN}/${YYYYMMDDHHi} @@ -110,31 +114,40 @@ cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE -cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} +#cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} +#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} rm -f ${DIRRUN}/degrib.bash +if [[ $MODERUN == "R" ]]; then + echo "MODERUN=R. Degribbing GFS data for both initial and lateral boundary conditions..." + dt=$((LBCINT / 3600)) + hours=($(generate_hours_list "00" "$dt" "$FCST")) + for hour in "${hours[@]}"; do + echo "Temporarily copying GFS data: gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f0${hour}.${YYYYMMDDHHi}.grib2" + fhour=$(printf "%03d" ${hour}) + cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f${fhour}.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} + done + + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] + then + sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; + s,#NNODES#,${DEGRIB_nnodes},g; + s,#NCPUS#,${DEGRIB_ncpus},g; + s,#NTASKS#,${DEGRIB_ncores},g; + s,#NTASKSPNODE#,${DEGRIB_ncpn},g; + s,#NTHREADS#,${DEGRIB_nthreads},g; + s,#PARTITION#,${DEGRIB_QUEUE},g; + s,#WALLTIME#,${DEGRIB_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib.bash + else + echo "#!/bin/bash " > ${DIRRUN}/degrib.bash + fi -if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] -then - sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; - s,#NNODES#,${DEGRIB_nnodes},g; - s,#NCPUS#,${DEGRIB_ncpus},g; - s,#NTASKS#,${DEGRIB_ncores},g; - s,#NTASKSPNODE#,${DEGRIB_ncpn},g; - s,#NTHREADS#,${DEGRIB_nthreads},g; - s,#PARTITION#,${DEGRIB_QUEUE},g; - s,#WALLTIME#,${DEGRIB_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ - ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib.bash -else - echo "#!/bin/bash " > ${DIRRUN}/degrib.bash -fi - -cat << EOF0 >> ${DIRRUN}/degrib.bash + cat << EOF0 >> ${DIRRUN}/degrib.bash ulimit -s unlimited ulimit -c unlimited @@ -154,12 +167,11 @@ ldd ungrib.exe rm -f GRIBFILE.* namelist.wps - -sed -e "s,#LABELI#,${start_date},g;s,#PREFIX#,GFS,g" \ +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#PREFIX#,GFS,g;s,#LBCINT#,${LBCINT},g;" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps echo "" -./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 +./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.*.grib2 chmod 755 * echo "" @@ -168,10 +180,8 @@ echo "submetendo jobs ungrib" time mpirun -np 1 ./ungrib.exe - date - grep "Successful completion of program ungrib.exe" ${DIRRUN}/ungrib.log >& /dev/null if [ \$? -ne 0 ]; then @@ -193,10 +203,90 @@ fi echo "End of degrib Job" +EOF0 + +elif [[ $MODERUN == "G" ]]; then + echo "MODERUN=G. Degribbing GFS data only for initial conditions..." + cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} + + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] + then + sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; + s,#NNODES#,${DEGRIB_nnodes},g; + s,#NCPUS#,${DEGRIB_ncpus},g; + s,#NTASKS#,${DEGRIB_ncores},g; + s,#NTASKSPNODE#,${DEGRIB_ncpn},g; + s,#NTHREADS#,${DEGRIB_nthreads},g; + s,#PARTITION#,${DEGRIB_QUEUE},g; + s,#WALLTIME#,${DEGRIB_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib.bash + else + echo "#!/bin/bash " > ${DIRRUN}/degrib.bash + fi + + cat << EOF0 > ${DIRRUN}/degrib.bash + +ulimit -s unlimited +ulimit -c unlimited +ulimit -v unlimited + +export PMIX_MCA_gds=hash + +export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 + +cd ${DIRRUN} + +. ${SCRIPTS}/setenv.bash +echo "-- PBS_JOBID: \$PBS_JOBID" + +ldd ungrib.exe + +rm -f GRIBFILE.* namelist.wps + +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,GFS,g" \ + +${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps + +./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 + +chmod 755 * +echo "" +date +echo "submetendo jobs ungrib" + +time mpirun -np 1 ./ungrib.exe + +date + +grep "Successful completion of program ungrib.exe" ${DIRRUN}/ungrib.log >& /dev/null +if [ \$? -ne 0 ]; then + echo " BUMMER: Ungrib generation failed for some yet unknown reason." + echo " " + tail -10 ${DIRRUN}/ungrib.log + echo " " + exit 21 +fi +# +# clean up and remove links +# + mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log + mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps + mv GFS\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre + rm -fr ${DATAIN}/${YYYYMMDDHHi} +echo "End of degrib Job" EOF0 -chmod a+x ${DIRRUN}/degrib.bash +else + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} LBCs phase fails during degrib! Please select MODERUN=R or G so that degrib can be done appropriately.\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 +fi + +chmod a+x ${DIRRUN}/degrib.bash case "${SCHEDULER_SYSTEM}" in SLURM) diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 186a8e7..b6caa4a 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -1,7 +1,6 @@ #!/bin/bash umask 022 - if [ $# -ne 4 ] then echo "" @@ -59,8 +58,6 @@ export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRU mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs - - if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] then if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] @@ -91,8 +88,13 @@ do fi done +if [[ $MODERUN == "R" ]]; then + BLEND_BDY_TERRAIN=true +else + BLEND_BDY_TERRAIN=false +fi -sed -e "s,#LABELI#,${start_date},g;s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g" \ +sed -e "s,#LABELI#,${start_date},g;s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g;s,#BLEND_BDY_TERRAIN#,${BLEND_BDY_TERRAIN},g" \ ${SCRIPTS}/namelists/namelist.init_atmosphere.TEMPLATE > ${DIRRUN}/namelist.init_atmosphere sed -e "s,#RES#,${RES},g" \ diff --git a/scripts/make_lbcs.bash b/scripts/make_lbcs.bash new file mode 100755 index 0000000..730a136 --- /dev/null +++ b/scripts/make_lbcs.bash @@ -0,0 +1,188 @@ +#!/bin/bash + + +if [ $# -ne 4 ] +then + echo "" + echo "Instructions: execute the command below" + echo "" + echo "${0} EXP_NAME RESOLUTION LABELI FCST" + echo "" + echo "EXP_NAME :: Forcing: GFS or ERA5" + echo " :: Others options to be added later..." + echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" + echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" + echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." + echo "" + echo "24 hour forcast example:" + echo "${0} GFS 1024002 2024010100 24" + echo "" + + exit +fi + +# Set environment variables exports: +echo "" +echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" +. setenv.bash + + +# Standart 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} +DATAIN=${DIRHOMED}/datain; mkdir -p ${DATAIN} +DATAOUT=${DIRHOMED}/dataout; mkdir -p ${DATAOUT} +SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} +EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} +#---------------------------------------------------------------------- + + +# Input variables:-------------------------------------- +EXP=${1}; #EXP=GFS +RES=${2}; #RES=1024002 +YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 +FCST=${4}; #FCST=24 +#------------------------------------------------------- + +# Local variables-------------------------------------- +start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 +yyyymmddi=${YYYYMMDDHHi:0:8} +hhi=${YYYYMMDDHHi:8:2} +yyyymmddhhf=$(date +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${FCST} hours" ) +final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhhf:8:2}:00:00 +GEODATA=${DATAIN}/WPS_GEOG +cores=${INITATMOS_ncores} +export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} +#------------------------------------------------------- +mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs + +if [ ! -s ${DATAIN}/fixed/${RES}.graph.info.part.${cores} ] +then + if [[ ${RES} == x1.* ]] + then + if [ ! -s ${DATAIN}/fixed/${RES}.graph.info ] + then + cd ${DATAIN}/fixed + echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" + wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/${RES}.tar.gz + wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/${RES}_static.tar.gz + tar -xzvf ${RES}.tar.gz + tar -xzvf ${RES}_static.tar.gz + fi + echo -e "${GREEN}==>${NC} Creating ${RES}.graph.info.part.${cores} ... \n" + cd ${DATAIN}/fixed + gpmetis -minconn -contig -niter=200 ${RES}.graph.info ${cores} + rm -fr ${RES}.tar.gz ${RES}_static.tar.gz + else + echo -e "${GREEN}==>${NC} Creating ${RES}.graph.info.part.${cores} ... \n" + cd ${DATAIN}/fixed + gpmetis -minconn -contig -niter=200 ${RES}.graph.info ${cores} + fi +fi + +files_needed=("${SCRIPTS}/namelists/namelist.init_atmosphere.LBCS" "${SCRIPTS}/namelists/streams.init_atmosphere.LBCS" "${DATAIN}/fixed/${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/${RES}.init.nc" "${EXECS}/init_atmosphere_model") +for file in "${files_needed[@]}" +do + if [ ! -s "${file}" ] + then + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} [${0}] At least the file ${file} was not generated. \n" + exit -1 + fi +done + + +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#GEODAT#,${GEODATA},g;s,#LBCINT#,${LBCINT},g;s,#RES#,${RES},g;s,#EXP#,${EXP},g" \ + ${SCRIPTS}/namelists/namelist.init_atmosphere.LBCS > ${DIRRUN}/namelist.init_atmosphere + +sed -e "s,#RES#,${RES},g;s,#LBCINT#,${LBCINT},g" \ + ${SCRIPTS}/namelists/streams.init_atmosphere.LBCS > ${DIRRUN}/streams.init_atmosphere + + +cp -f ${DATAIN}/fixed/${RES}.graph.info.part.${cores} ${DIRRUN} +cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/${RES}.init.nc ${DIRRUN} +cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}\:* ${DIRRUN} +cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} + + +cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} +rm -f ${DIRRUN}/lbcs.bash + +if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] +then + sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; + s,#NNODES#,${LBCS_nnodes},g; + s,#NCPUS#,${LBCS_ncpus},g; + s,#NTASKS#,${LBCS_ncores},g; + s,#NTASKSPNODE#,${LBCS_ncpn},g; + s,#NTHREADS#,${LBCS_nthreads},g; + s,#PARTITION#,${LBCS_QUEUE},g; + s,#WALLTIME#,${LBCS_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/lbcs.bash +else + echo "#!/bin/bash " > ${DIRRUN}/lbcs.bash +fi + +cat << EOF0 > ${DIRRUN}/lbcs.bash + +export executable=init_atmosphere_model + +ulimit -c unlimited +ulimit -v unlimited +ulimit -s unlimited + + +. $(pwd)/setenv.bash + +cd ${DIRRUN} + + +date +time mpirun -np \${SLURM_NTASKS} ./\${executable} +date + +mv ${DIRRUN}/log.init_atmosphere.0000.out ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/log.init_atmosphere.0000.${RES}.lbcs.nc.${YYYYMMDDHHi}.out +mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.init_atmosphere.lbcs +mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/streams.init_atmosphere.lbcs +mv ${DIRRUN}/${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre +mv ${DIRRUN}/lbc*.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre + +EOF0 +chmod a+x ${DIRRUN}/lbcs.bash + +case "${SCHEDULER_SYSTEM}" in + SLURM) + echo -e "${GREEN}==>${NC} Sbatch lbcs.bash...\n" + cd ${DIRRUN} + sbatch --wait ${DIRRUN}/lbcs.bash + ;; + PBS) + echo -e "${GREEN}==>${NC} qsub lbcs.bash...\n" + cd ${DIRRUN} + qsub -W block=true ${DIRRUN}/lbcs.bash + ;; +# GENERIC) +# echo "Nenhum gerenciador detectado" +# cd ${DIRRUN} +# ${DIRRUN}/lbcs.bash +# ;; +esac + +echo -e "${GREEN}==>${NC} Executing sbatch lbcs.bash...\n" +cd ${DIRRUN} + +mv ${DIRRUN}/lbcs.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs + +if [ -z "$(ls ${DATAOUT}/${YYYYMMDDHHi}/Pre/lbc* 2>/dev/null)" ] +then + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} LBC phase fails! Check logs at ${DATAOUT}/logs/lbcs.* .\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 +fi +chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* + +rm -fr ${DIRRUN} diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 2d6abf4..73ae529 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -8,10 +8,10 @@ umask 022 # # Performs the following tasks: # -# o VCheck all input files before -# o Creates the submition script +# o Check all input files before +# o Creates the submission script # o Submit the post -# o Veriffy all files generated +# o Verify all files generated # # #-----------------------------------------------------------------------------# @@ -90,7 +90,28 @@ IFS=":" read -r h m s <<< "${t_strout}" printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # Calculating default parameters for different resolutions -if [ $RES -eq 1024002 ]; then #24Km +if [ $RES -eq 40962 ]; then #120Km + NLAT=150 #180/1.2 + NLON=300 #360/1.2 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 163842 ]; then #60Km + NLAT=301 #180/0.6 + NLON=601 #360/0.6 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 655362 ]; then #30Km + NLAT=601 #180/0.3 + NLON=1201 #360/0.3 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 1024002 ]; then #24Km NLAT=721 #180/0.25 NLON=1441 #360/0.25 STARTLAT=-90.0 @@ -104,9 +125,23 @@ elif [ $RES -eq 2621442 ]; then #15Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [ $RES -eq 40962 ]; then #120Km - NLAT=150 #180/1.2 - NLON=300 #360/1.2 +elif [ $RES -eq 5898242 ]; then #10Km + NLAT=1801 #180/0.10 (+1) + NLON=3601 #360/0.10 (+1) + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 23592962 ]; then #5Km + NLAT=3601 #180/0.05 + NLON=7201 #360/0.05 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 +elif [ $RES -eq 65536002 ]; then #3Km + NLAT=6001 #180/0.03 + NLON=12001 #360/0.03 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 diff --git a/scripts/namelists/namelist.atmosphere.TEMPLATE b/scripts/namelists/namelist.atmosphere.TEMPLATE index d234253..c4f103d 100755 --- a/scripts/namelists/namelist.atmosphere.TEMPLATE +++ b/scripts/namelists/namelist.atmosphere.TEMPLATE @@ -34,7 +34,7 @@ config_xnutr = 0.2 / &limited_area - config_apply_lbcs = false + config_apply_lbcs = #APPLY_LBCS# / &io config_pio_num_iotasks = 0 diff --git a/scripts/namelists/namelist.init_atmosphere.LBCS b/scripts/namelists/namelist.init_atmosphere.LBCS new file mode 100755 index 0000000..2622af6 --- /dev/null +++ b/scripts/namelists/namelist.init_atmosphere.LBCS @@ -0,0 +1,48 @@ +&nhyd_model + config_init_case = 9 + config_start_time = '#LABELI#' + config_stop_time = '#LABELF#' + config_theta_adv_order = 3 + config_coef_3rd_order = 0.25 +/ +&dimensions + config_nvertlevels = 55 + config_nsoillevels = 4 + config_nfglevels = 35 + config_nfgsoillevels = 4 +/ +&data_sources + config_geog_data_path = '#GEODAT#' + config_met_prefix = '#EXP#' + config_sfc_prefix = 'SST' + config_fg_interval = #LBCINT# + config_landuse_data = 'MODIFIED_IGBP_MODIS_NOAH' + config_topo_data = 'GMTED2010' + config_use_spechumd = true +/ +&vertical_grid + config_ztop = 30000.0 + config_nsmterrain = 1 + config_smooth_surfaces = true + config_dzmin = 0.3 + config_nsm = 30 + config_tc_vertical_grid = true +/ +&interpolation_control + config_extrap_airtemp = 'linear' +/ +&preproc_stages + config_static_interp = false + config_native_gwd_static = false + config_vertical_grid = true + config_met_interp = true + config_input_sst = false + config_frac_seaice = true +/ +&io + config_pio_num_iotasks = 0 + config_pio_stride = 1 +/ +&decomposition + config_block_decomp_file_prefix = '#RES#.graph.info.part.' +/ diff --git a/scripts/namelists/namelist.init_atmosphere.TEMPLATE b/scripts/namelists/namelist.init_atmosphere.TEMPLATE index 2b560a1..18bf2b2 100755 --- a/scripts/namelists/namelist.init_atmosphere.TEMPLATE +++ b/scripts/namelists/namelist.init_atmosphere.TEMPLATE @@ -13,7 +13,7 @@ / &data_sources config_geog_data_path = '#GEODAT#' - config_met_prefix = 'GFS' + config_met_prefix = '#EXP#' config_sfc_prefix = 'SST' config_fg_interval = 86400 config_landuse_data = 'MODIFIED_IGBP_MODIS_NOAH' @@ -27,6 +27,7 @@ config_dzmin = 0.3 config_nsm = 30 config_tc_vertical_grid = true + config_blend_bdy_terrain = #BLEND_BDY_TERRAIN# / &interpolation_control config_extrap_airtemp = 'linear' diff --git a/scripts/namelists/namelist.wps.TEMPLATE b/scripts/namelists/namelist.wps.TEMPLATE index 2aaff90..9694f11 100755 --- a/scripts/namelists/namelist.wps.TEMPLATE +++ b/scripts/namelists/namelist.wps.TEMPLATE @@ -2,8 +2,8 @@ wrf_core = 'ARW', max_dom = 1, start_date = '#LABELI#', - end_date = '#LABELI#', - interval_seconds = 10800, + end_date = '#LABELF#', + interval_seconds = #LBCINT#, io_form_geogrid = 2, debug_level = 0, / diff --git a/scripts/namelists/streams.atmosphere.TEMPLATE b/scripts/namelists/streams.atmosphere.TEMPLATE index 04def1c..d6c28bc 100755 --- a/scripts/namelists/streams.atmosphere.TEMPLATE +++ b/scripts/namelists/streams.atmosphere.TEMPLATE @@ -45,4 +45,11 @@ packages="iau" input_interval="initial_only" /> + + diff --git a/scripts/namelists/streams.init_atmosphere.LBCS b/scripts/namelists/streams.init_atmosphere.LBCS new file mode 100755 index 0000000..e073431 --- /dev/null +++ b/scripts/namelists/streams.init_atmosphere.LBCS @@ -0,0 +1,20 @@ + + + + + + + diff --git a/scripts/setenv.bash b/scripts/setenv.bash index fa2f731..e17fcf3 100755 --- a/scripts/setenv.bash +++ b/scripts/setenv.bash @@ -1,6 +1,10 @@ #!/bin/bash umask 022 +# Choose the simulation mode: +MODERUN=R # R=Regional simulation | G=Global simulation. +LBCINT=21600 # Interval (seconds) for updating lateral boundary conditions (when regional) + # Choose your compiler here (only on Jaci; on Egeon the compiler is fixed to ‘gnu’): export COMPILER=intel #export COMPILER=gnu diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index 22a7c5e..61203c2 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -27,7 +27,6 @@ export STATIC_nthreads=1 export STATIC_jobname="Pre.static" export STATIC_walltime="02:00:00" - # PRE-Degrib phase: export DEGRIB_QUEUE="pesqextra" export DEGRIB_ncores=1 @@ -38,7 +37,6 @@ export DEGRIB_nthreads=1 export DEGRIB_jobname="Pre.degrib" export DEGRIB_walltime="02:00:00" - # PRE-Init Atmosphere phase: export INITATMOS_QUEUE="pesqextra" export INITATMOS_ncores=512 @@ -49,6 +47,11 @@ export INITATMOS_nthreads=1 export INITATMOS_jobname="Pre.InitAtmos" export INITATMOS_walltime="02:00:00" +# PRE-LBCs phase: +export LBCS_QUEUE="pesqextra" +export LBCS_ncores=64 +export LBCS_nnodes=1 +export LBCS_jobname="Pre.LBCS" # Model phase: export MODEL_QUEUE="pesqextra" From 8dc64ed73ac7ad95bb723f042cc9a934fd68aa5c Mon Sep 17 00:00:00 2001 From: Joao Messias Date: Tue, 16 Jun 2026 18:11:56 +0000 Subject: [PATCH 69/72] fixed regional feature --- scripts/3.run_model.bash | 9 ++ scripts/4.run_post.bash | 29 +++- scripts/make_degrib_GFS.bash | 26 ++-- scripts/make_initatmos.bash | 4 +- scripts/make_lbcs.bash | 63 ++++---- scripts/make_template.bash | 138 +++++++++++------- .../namelists/namelist.init_atmosphere.LBCS | 2 +- .../namelists/streams.init_atmosphere.LBCS | 2 +- scripts/setenv.bash | 4 +- scripts/stools/setenv_PBS_ian_intel.bash | 8 +- 10 files changed, 172 insertions(+), 113 deletions(-) diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 7f5ae8c..81a0d13 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -98,6 +98,9 @@ elif [ $RES -eq 163842 ]; then #60Km elif [ $RES -eq 655362 ]; then #30Km CONFIG_DT=150.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [[ "$RES" == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) + CONFIG_DT=150.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 1024002 ]; then #24Km CONFIG_DT=150.0 CONFIG_CONV_INTERVAL="00:15:00" @@ -107,9 +110,15 @@ elif [ $RES -eq 2621442 ]; then #15Km elif [ $RES -eq 5898242 ]; then #10Km CONFIG_DT=60.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [[ "$RES" == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) + CONFIG_DT=60.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 23592962 ]; then #5km CONFIG_DT=30.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [[ "$RES" == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) + CONFIG_DT=30.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [ $RES -eq 65536002 ]; then #3Km CONFIG_DT=18.0 CONFIG_CONV_INTERVAL="00:15:00" diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 85eda74..9a8d4f3 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -89,8 +89,8 @@ printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # Calculating default parameters for different resolutions if [ $RES -eq 40962 ]; then #120Km - NLAT=150 #180/1.2 - NLON=300 #360/1.2 + NLAT=151 #180/1.2 + NLON=301 #360/1.2 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 @@ -109,6 +109,13 @@ elif [ $RES -eq 655362 ]; then #30Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [[ $RES == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) + NLAT=368 #110/0.3 +1 + NLON=334 #100/0.3 +1 + STARTLAT=-70.0 + ENDLAT=40 + STARTLON=240.0 + ENDLON=340.0 elif [ $RES -eq 1024002 ]; then #24Km NLAT=721 #180/0.25 NLON=1441 #360/0.25 @@ -124,12 +131,19 @@ elif [ $RES -eq 2621442 ]; then #15Km ENDLAT=90.0 ENDLON=360.0 elif [ $RES -eq 5898242 ]; then #10Km - NLAT=1801 #180/0.10 (+1) - NLON=3601 #360/0.10 (+1) + NLAT=1801 #180/0.10 + NLON=3601 #360/0.10 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [[ $RES == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) + NLAT=1101 #110/0.1 +1 + NLON=1001 #100/0.1 +1 + STARTLAT=-70.0 + ENDLAT=40.0 + STARTLON=240.0 + ENDLON=340.0 elif [ $RES -eq 23592962 ]; then #5Km NLAT=3601 #180/0.05 NLON=7201 #360/0.05 @@ -137,6 +151,13 @@ elif [ $RES -eq 23592962 ]; then #5Km STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +elif [[ $RES == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) + NLAT=2201 #110/0.05 +1 + NLON=2001 #100/0.05 +1 + STARTLAT=-70.0 + ENDLAT=40.0 + STARTLON=240.0 + ENDLON=340.0 elif [ $RES -eq 65536002 ]; then #3Km NLAT=6001 #180/0.03 NLON=12001 #360/0.03 diff --git a/scripts/make_degrib_GFS.bash b/scripts/make_degrib_GFS.bash index feb3243..b9533b3 100755 --- a/scripts/make_degrib_GFS.bash +++ b/scripts/make_degrib_GFS.bash @@ -51,8 +51,6 @@ FCST=${4}; #FCST=24 #------------------------------------------------------- - - # Local variables-------------------------------------- start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 yyyymmddi=${YYYYMMDDHHi:0:8} @@ -123,11 +121,11 @@ rm -f ${DIRRUN}/degrib.bash if [[ $MODERUN == "R" ]]; then echo "MODERUN=R. Degribbing GFS data for both initial and lateral boundary conditions..." dt=$((LBCINT / 3600)) - hours=($(generate_hours_list "00" "$dt" "$FCST")) - for hour in "${hours[@]}"; do - echo "Temporarily copying GFS data: gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f0${hour}.${YYYYMMDDHHi}.grib2" - fhour=$(printf "%03d" ${hour}) - cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f${fhour}.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} + + for ((hour=0; hour<=FCST; hour+=dt)); do + hour_fmt=$(printf "%03d" "$hour") + echo "Temporarily copying GFS data: gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f${hour_fmt}.${YYYYMMDDHHi}.grib2" + cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f${hour_fmt}.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} done if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] @@ -167,8 +165,8 @@ ldd ungrib.exe rm -f GRIBFILE.* namelist.wps -sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#PREFIX#,GFS,g;s,#LBCINT#,${LBCINT},g;" \ - ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,GFS,g" \ + ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps echo "" ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.*.grib2 @@ -197,8 +195,7 @@ fi # mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps - mv GFS\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre - + mv GFS* ${DATAOUT}/${YYYYMMDDHHi}/Pre rm -fr ${DATAIN}/${YYYYMMDDHHi} echo "End of degrib Job" @@ -226,7 +223,7 @@ elif [[ $MODERUN == "G" ]]; then echo "#!/bin/bash " > ${DIRRUN}/degrib.bash fi - cat << EOF0 > ${DIRRUN}/degrib.bash + cat << EOF0 >> ${DIRRUN}/degrib.bash ulimit -s unlimited ulimit -c unlimited @@ -247,8 +244,7 @@ ldd ungrib.exe rm -f GRIBFILE.* namelist.wps sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,GFS,g" \ - -${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps + ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 @@ -277,6 +273,7 @@ fi mv GFS\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre rm -fr ${DATAIN}/${YYYYMMDDHHi} echo "End of degrib Job" + EOF0 else @@ -327,5 +324,4 @@ mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/log mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e.${JOBID} chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o.${JOBID} chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e.${JOBID} - rm -fr ${DIRRUN} diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index b6caa4a..2228f0b 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -94,8 +94,8 @@ else BLEND_BDY_TERRAIN=false fi -sed -e "s,#LABELI#,${start_date},g;s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g;s,#BLEND_BDY_TERRAIN#,${BLEND_BDY_TERRAIN},g" \ - ${SCRIPTS}/namelists/namelist.init_atmosphere.TEMPLATE > ${DIRRUN}/namelist.init_atmosphere +sed -e "s,#LABELI#,${start_date},g;s,#GEODAT#,${GEODATA},g;s,#RES#,${RES},g;s,#EXP#,${EXP},g;s,#BLEND_BDY_TERRAIN#,${BLEND_BDY_TERRAIN},g" \ + ${SCRIPTS}/namelists/namelist.init_atmosphere.TEMPLATE > ${DIRRUN}/namelist.init_atmosphere sed -e "s,#RES#,${RES},g" \ ${SCRIPTS}/namelists/streams.init_atmosphere.TEMPLATE > ${DIRRUN}/streams.init_atmosphere diff --git a/scripts/make_lbcs.bash b/scripts/make_lbcs.bash index 730a136..37de28f 100755 --- a/scripts/make_lbcs.bash +++ b/scripts/make_lbcs.bash @@ -52,36 +52,30 @@ hhi=${YYYYMMDDHHi:8:2} yyyymmddhhf=$(date +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${FCST} hours" ) final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhhf:8:2}:00:00 GEODATA=${DATAIN}/WPS_GEOG -cores=${INITATMOS_ncores} +cores=${LBCS_ncores} export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} #------------------------------------------------------- mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -if [ ! -s ${DATAIN}/fixed/${RES}.graph.info.part.${cores} ] +if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ] then - if [[ ${RES} == x1.* ]] + if [ ! -s ${DATAIN}/fixed/x1.${RES}.graph.info ] then - if [ ! -s ${DATAIN}/fixed/${RES}.graph.info ] - then - cd ${DATAIN}/fixed - echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/${RES}_static.tar.gz - tar -xzvf ${RES}.tar.gz - tar -xzvf ${RES}_static.tar.gz - fi - echo -e "${GREEN}==>${NC} Creating ${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 ${RES}.graph.info ${cores} - rm -fr ${RES}.tar.gz ${RES}_static.tar.gz - else - echo -e "${GREEN}==>${NC} Creating ${RES}.graph.info.part.${cores} ... \n" + echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" cd ${DATAIN}/fixed - gpmetis -minconn -contig -niter=200 ${RES}.graph.info ${cores} + wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz + wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz + tar -xzvf x1.${RES}.tar.gz + tar -xzvf x1.${RES}_static.tar.gz fi + echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" + cd ${DATAIN}/fixed + gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} + rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz fi -files_needed=("${SCRIPTS}/namelists/namelist.init_atmosphere.LBCS" "${SCRIPTS}/namelists/streams.init_atmosphere.LBCS" "${DATAIN}/fixed/${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/${RES}.init.nc" "${EXECS}/init_atmosphere_model") +files_needed=("${SCRIPTS}/namelists/namelist.init_atmosphere.LBCS" "${SCRIPTS}/namelists/streams.init_atmosphere.LBCS" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${EXECS}/init_atmosphere_model") for file in "${files_needed[@]}" do if [ ! -s "${file}" ] @@ -100,8 +94,8 @@ sed -e "s,#RES#,${RES},g;s,#LBCINT#,${LBCINT},g" \ ${SCRIPTS}/namelists/streams.init_atmosphere.LBCS > ${DIRRUN}/streams.init_atmosphere -cp -f ${DATAIN}/fixed/${RES}.graph.info.part.${cores} ${DIRRUN} -cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/${RES}.init.nc ${DIRRUN} +cp -f ${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores} ${DIRRUN} +cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc ${DIRRUN} cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/${EXP}\:* ${DIRRUN} cp -f ${EXECS}/init_atmosphere_model ${DIRRUN} @@ -111,7 +105,7 @@ rm -f ${DIRRUN}/lbcs.bash if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] then - sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; + sed -e "s,#JOBNAME#,${LBCS_jobname},g; s,#NNODES#,${LBCS_nnodes},g; s,#NCPUS#,${LBCS_ncpus},g; s,#NTASKS#,${LBCS_ncores},g; @@ -119,14 +113,14 @@ then s,#NTHREADS#,${LBCS_nthreads},g; s,#PARTITION#,${LBCS_QUEUE},g; s,#WALLTIME#,${LBCS_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.e,g" \ ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/lbcs.bash else echo "#!/bin/bash " > ${DIRRUN}/lbcs.bash fi -cat << EOF0 > ${DIRRUN}/lbcs.bash +cat << EOF0 >> ${DIRRUN}/lbcs.bash export executable=init_atmosphere_model @@ -134,20 +128,24 @@ ulimit -c unlimited ulimit -v unlimited ulimit -s unlimited - -. $(pwd)/setenv.bash +. ${SCRIPTS}/setenv.bash cd ${DIRRUN} +if [ "$HOSTNAME" = "egeon" ]; then + echo "-- SLURM_JOB_ID: \$SLURM_JOB_ID" + time mpirun -np ${LBCS_ncores} ./\${executable} +else + echo "-- PBS_JOBID: \$PBS_JOBID" + time mpirun --ppn ${LBCS_ncpn} -np ${LBCS_ncores} --depth=${LBCS_nthreads} --cpu-bind depth ./\${executable} +fi -date -time mpirun -np \${SLURM_NTASKS} ./\${executable} date mv ${DIRRUN}/log.init_atmosphere.0000.out ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/log.init_atmosphere.0000.${RES}.lbcs.nc.${YYYYMMDDHHi}.out mv ${DIRRUN}/namelist.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.init_atmosphere.lbcs mv ${DIRRUN}/streams.init_atmosphere ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/streams.init_atmosphere.lbcs -mv ${DIRRUN}/${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre +mv ${DIRRUN}/x1.${RES}.init.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre mv ${DIRRUN}/lbc*.nc ${DATAOUT}/${YYYYMMDDHHi}/Pre EOF0 @@ -185,4 +183,9 @@ then fi chmod 775 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* +JOBID=$(sed -n '4p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.o.${JOBID} +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.e.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.o.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/lbcs.e.${JOBID} rm -fr ${DIRRUN} diff --git a/scripts/make_template.bash b/scripts/make_template.bash index 73ae529..b1983ec 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -90,63 +90,89 @@ IFS=":" read -r h m s <<< "${t_strout}" printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # Calculating default parameters for different resolutions -if [ $RES -eq 40962 ]; then #120Km - NLAT=150 #180/1.2 - NLON=300 #360/1.2 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 163842 ]; then #60Km - NLAT=301 #180/0.6 - NLON=601 #360/0.6 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 655362 ]; then #30Km - NLAT=601 #180/0.3 - NLON=1201 #360/0.3 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 1024002 ]; then #24Km - NLAT=721 #180/0.25 - NLON=1441 #360/0.25 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 2621442 ]; then #15Km - NLAT=1201 #180/0.15 - NLON=2401 #360/0.15 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 5898242 ]; then #10Km - NLAT=1801 #180/0.10 (+1) - NLON=3601 #360/0.10 (+1) - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 23592962 ]; then #5Km - NLAT=3601 #180/0.05 - NLON=7201 #360/0.05 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 -elif [ $RES -eq 65536002 ]; then #3Km - NLAT=6001 #180/0.03 - NLON=12001 #360/0.03 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 +if [[ $MODERUN == "G" ]]; then + if [ $RES -eq 40962 ]; then #120Km + NLAT=151 #180/1.2 + NLON=301 #360/1.2 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 163842 ]; then #60Km + NLAT=301 #180/0.6 + NLON=601 #360/0.6 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 655362 ]; then #30Km + NLAT=601 #180/0.3 + NLON=1201 #360/0.3 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 1024002 ]; then #24Km + NLAT=721 #180/0.25 + NLON=1441 #360/0.25 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 2621442 ]; then #15Km + NLAT=1201 #180/0.15 + NLON=2401 #360/0.15 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 5898242 ]; then #10Km + NLAT=1801 #180/0.10 (+1) + NLON=3601 #360/0.10 (+1) + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 23592962 ]; then #5Km + NLAT=3601 #180/0.05 + NLON=7201 #360/0.05 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + elif [ $RES -eq 65536002 ]; then #3Km + NLAT=6001 #180/0.03 + NLON=12001 #360/0.03 + STARTLAT=-90.0 + STARTLON=0.0 + ENDLAT=90.0 + ENDLON=360.0 + fi +elif [[ $MODERUN == "R" ]]; then + if [[ "$RES" == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) + NLAT=368 #110/0.3 +1 + NLON=334 #100/0.3 +1 + STARTLAT=-65.0 + ENDLAT=40 + STARTLON=240.0 + ENDLON=340.0 + elif [[ $RES == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) + NLAT=1101 #110/0.1 + 1 + NLON=1001 #100/0.1 + 1 + STARTLAT=-70.0 + ENDLAT=40.0 + STARTLON=240.0 + ENDLON=340.0 + elif [[ $RES == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) + NLAT=2201 #110/0.05 + 1 + NLON=2001 #100/0.05 + 1 + STARTLAT=-70.0 + ENDLAT=40.0 + STARTLON=240.0 + ENDLON=340.0 + fi fi + #------------------------------------------------------- # NLEVS get from t_iso_levels in Registry_isobaric.xml: diff --git a/scripts/namelists/namelist.init_atmosphere.LBCS b/scripts/namelists/namelist.init_atmosphere.LBCS index 2622af6..8e4ba81 100755 --- a/scripts/namelists/namelist.init_atmosphere.LBCS +++ b/scripts/namelists/namelist.init_atmosphere.LBCS @@ -44,5 +44,5 @@ config_pio_stride = 1 / &decomposition - config_block_decomp_file_prefix = '#RES#.graph.info.part.' + config_block_decomp_file_prefix = 'x1.#RES#.graph.info.part.' / diff --git a/scripts/namelists/streams.init_atmosphere.LBCS b/scripts/namelists/streams.init_atmosphere.LBCS index e073431..234cd40 100755 --- a/scripts/namelists/streams.init_atmosphere.LBCS +++ b/scripts/namelists/streams.init_atmosphere.LBCS @@ -1,7 +1,7 @@ Date: Wed, 1 Jul 2026 01:32:08 +0000 Subject: [PATCH 70/72] fixed regional feature and ERA5 - issue #1001 #956 --- scripts/0.run_all.bash | 7 +- scripts/1.install_monan.bash | 6 - scripts/2.pre_processing.bash | 6 +- scripts/3.run_model.bash | 46 +- scripts/4.run_post.bash | 78 +- scripts/make_degrib_ERA5.bash | 218 +++--- scripts/make_degrib_GFS.bash | 89 ++- scripts/make_initatmos.bash | 4 +- scripts/make_lbcs.bash | 4 +- scripts/make_static.bash | 4 +- scripts/make_template.bash | 103 +-- scripts/namelists/include_fields.diag | 72 -- scripts/namelists/include_fields.diag.CD-CT | 695 ------------------ scripts/namelists/include_fields.diag.GCC | 72 -- .../stream_list.atmosphere.diagnostics | 72 -- .../stream_list.atmosphere.diagnostics.CD-CT | 695 ------------------ .../stream_list.atmosphere.diagnostics.GCC | 72 -- scripts/namelists/streams.atmosphere.TEMPLATE | 4 +- scripts/stools/setenv_PBS_ian_cray.bash | 11 +- scripts/stools/setenv_PBS_ian_gnu.bash | 12 +- scripts/stools/setenv_PBS_ian_intel.bash | 5 +- 21 files changed, 288 insertions(+), 1987 deletions(-) delete mode 100755 scripts/namelists/include_fields.diag delete mode 100755 scripts/namelists/include_fields.diag.CD-CT delete mode 100755 scripts/namelists/include_fields.diag.GCC delete mode 100755 scripts/namelists/stream_list.atmosphere.diagnostics delete mode 100755 scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT delete mode 100755 scripts/namelists/stream_list.atmosphere.diagnostics.GCC diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index 4fa50e4..b7159ad 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -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=2026012000 #Check dates disponible for the initial condition (CI) using ERA5 FCST=24 #---------------------------------------------------------------------- diff --git a/scripts/1.install_monan.bash b/scripts/1.install_monan.bash index a797ca1..fb1fc61 100755 --- a/scripts/1.install_monan.bash +++ b/scripts/1.install_monan.bash @@ -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 @@ -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} diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 9cc8a0b..2420911 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -94,7 +94,7 @@ then fi # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- -if [[ $EXP == "GFS" || $EXP == "ERA5" ]]; then +if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" || ${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" @@ -116,7 +116,7 @@ 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} == "ERA5" ]] +elif [[ ${EXP} == "ERA5" || ${EXP} == "ERA" ]] then echo -e "${GREEN}==>${NC} Submitting Degrib for ERA5 data...\n" time ./make_degrib_ERA5.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} @@ -129,7 +129,7 @@ fi #---------------------------------------------------------------------------------- # Init Atmosphere phase:------------------------------------------------------------ -if [[ $EXP == "GFS" || $EXP == "ERA5" ]]; then +if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" || ${EXP} == "ERA" ]]; then echo -e "${GREEN}==>${NC} Submitting Init Atmosphere for real case...\n" time ./make_initatmos.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} else diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 81a0d13..0b3961d 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -89,39 +89,41 @@ printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # From now on, CONFI_LEN_DISP becames cte = 0.0, pickin up this value from static file. # Calculating default parameters for different resolutions -if [ $RES -eq 40962 ]; then #120Km +# global mesh +if [[ "$RES" == "40962" ]]; then #120Km CONFIG_DT=600.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 163842 ]; then #60Km +elif [[ "$RES" == "163842" ]]; then #60Km CONFIG_DT=300.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 655362 ]; then #30Km +elif [[ "$RES" == "655362" ]]; then #30Km CONFIG_DT=150.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [[ "$RES" == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) - CONFIG_DT=150.0 - CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 1024002 ]; then #24Km +elif [[ "$RES" == "1024002" ]]; then #24Km CONFIG_DT=150.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 2621442 ]; then #15Km +elif [[ "$RES" == "2621442" ]]; then #15Km CONFIG_DT=90.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 5898242 ]; then #10Km +elif [[ "$RES" == "5898242" ]]; then #10Km CONFIG_DT=60.0 CONFIG_CONV_INTERVAL="00:15:00" +elif [[ "$RES" == "23592962" ]]; then #5km + CONFIG_DT=30.0 + CONFIG_CONV_INTERVAL="00:15:00" +elif [[ "$RES" == "65536002" ]]; then #3Km + CONFIG_DT=18.0 + CONFIG_CONV_INTERVAL="00:15:00" +# regional mesh +elif [[ "$RES" == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) + CONFIG_DT=150.0 + CONFIG_CONV_INTERVAL="00:15:00" elif [[ "$RES" == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) CONFIG_DT=60.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 23592962 ]; then #5km - CONFIG_DT=30.0 - CONFIG_CONV_INTERVAL="00:15:00" elif [[ "$RES" == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) CONFIG_DT=30.0 CONFIG_CONV_INTERVAL="00:15:00" -elif [ $RES -eq 65536002 ]; then #3Km - CONFIG_DT=18.0 - CONFIG_CONV_INTERVAL="00:15:00" else echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" echo -e "${RED}==>${NC} [${0}] Simulation parameters for resolution $RES have not been set! Edit them in '3.run_model.bash'.\n" @@ -129,11 +131,13 @@ else fi #------------------------------------------------------- -# Setting configuration to apply or not lateral boundary conditions +# Setting configuration to apply or not lateral boundary conditions and output filename if [[ $MODERUN == "R" ]]; then APPLY_LBCS=true + RORG=R elif [[ $MODERUN == "G" ]]; then APPLY_LBCS=false + RORG=G else echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" echo -e "${RED}==>${NC} Atmosphere phase fails! Please select MODERUN=R (Regional) or MODERUN=G (Global) in 'setenv.bash' so that MONAN knows whether to read or not lateral boundary conditions.\n" @@ -156,14 +160,12 @@ then cd ${DATAIN}/fixed echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz + rm -fr x1.${RES}.tar.gz fi @@ -190,13 +192,13 @@ cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN} if [[ $MODERUN == "R" ]]; then cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/lbc*.nc ${DIRRUN} fi -if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" ]] +if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" || ${EXP} == "ERA" ]] then sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g;s,#APPLY_LBCS#,${APPLY_LBCS},g" \ ${SCRIPTS}/namelists/namelist.atmosphere.TEMPLATE > ${DIRRUN}/namelist.atmosphere - sed -e "s,#RES#,${RES},g;s,#LBCINT#,${LBCINT},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ + sed -e "s,#RES#,${RES},g;s,#RORG#,${RORG},g;s,#LBCINT#,${LBCINT},g;s,#CIORIG#,${EXP},g;s,#LABELI#,${YYYYMMDDHHi},g;s,#NLEV#,${NLEV},g" \ ${SCRIPTS}/namelists/streams.atmosphere.TEMPLATE > ${DIRRUN}/streams.atmosphere fi cp -f ${SCRIPTS}/namelists/stream_list.atmosphere.output ${DIRRUN} @@ -301,7 +303,7 @@ do i=$(printf "%04d" ${ii}) hh=${YYYYMMDDHHi:8:2} currentdate=$(date -d "${YYYYMMDDHHi:0:8} ${hh}:00:00 $(echo "(${i}-1)*${t_strout:0:2}" | bc) hours $(echo "(${i}-1)*${t_strout:3:2}" | bc) minutes $(echo "(${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") - file=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_${currentdate}.x${RES}L${NLEV}.nc + file=MONAN_DIAG_${RORG}_MOD_${EXP}_${YYYYMMDDHHi}_${currentdate}.x${RES}L${NLEV}.nc if [ ! -s ${DATAOUT}/${YYYYMMDDHHi}/Model/${file} ] then diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 9a8d4f3..72abdc9 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -83,88 +83,104 @@ t_stroutsec=$(echo ${t_strout} | awk -F: '{print ($1 * 3600) + ($2 * 60) + $3}') t_strouthor=$(echo "scale=4; (${t_stroutsec}/60)/60" | bc) #------------------------------------------------------------------------------------ +# Definindo G ou R no MONAN_DIAG +if [[ $MODERUN == "R" ]]; then + RORG=R +elif [[ $MODERUN == "G" ]]; then + RORG=G +else + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} Post fails! Please select MODERUN=R (Regional) or MODERUN=G (Global) in 'setenv.bash'.\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 +fi +#------------------------------------------------------------------------------------ + + # Format to HH:MM:SS t_strout (output_interval) IFS=":" read -r h m s <<< "${t_strout}" printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" # Calculating default parameters for different resolutions -if [ $RES -eq 40962 ]; then #120Km +# global mesh +if [[ "$RES" == "40962" ]]; then #120Km NLAT=151 #180/1.2 NLON=301 #360/1.2 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [ $RES -eq 163842 ]; then #60Km +elif [[ "$RES" == "163842" ]]; then #60Km NLAT=301 #180/0.6 NLON=601 #360/0.6 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [ $RES -eq 655362 ]; then #30Km +elif [[ "$RES" == "655362" ]]; then #30Km NLAT=601 #180/0.3 NLON=1201 #360/0.3 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [[ $RES == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) - NLAT=368 #110/0.3 +1 - NLON=334 #100/0.3 +1 - STARTLAT=-70.0 - ENDLAT=40 - STARTLON=240.0 - ENDLON=340.0 -elif [ $RES -eq 1024002 ]; then #24Km +elif [[ "$RES" == "1024002" ]]; then #24Km NLAT=721 #180/0.25 NLON=1441 #360/0.25 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [ $RES -eq 2621442 ]; then #15Km +elif [[ "$RES" == "2621442" ]]; then #15Km NLAT=1201 #180/0.15 NLON=2401 #360/0.15 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [ $RES -eq 5898242 ]; then #10Km +elif [[ "$RES" == "5898242" ]]; then #10Km NLAT=1801 #180/0.10 NLON=3601 #360/0.10 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [[ $RES == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) - NLAT=1101 #110/0.1 +1 - NLON=1001 #100/0.1 +1 - STARTLAT=-70.0 - ENDLAT=40.0 - STARTLON=240.0 - ENDLON=340.0 -elif [ $RES -eq 23592962 ]; then #5Km +elif [[ "$RES" == "23592962" ]]; then #5Km NLAT=3601 #180/0.05 NLON=7201 #360/0.05 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 -elif [[ $RES == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) - NLAT=2201 #110/0.05 +1 - NLON=2001 #100/0.05 +1 - STARTLAT=-70.0 - ENDLAT=40.0 - STARTLON=240.0 - ENDLON=340.0 -elif [ $RES -eq 65536002 ]; then #3Km +elif [[ "$RES" == "65536002" ]]; then #3Km NLAT=6001 #180/0.03 NLON=12001 #360/0.03 STARTLAT=-90.0 STARTLON=0.0 ENDLAT=90.0 ENDLON=360.0 +# regional mesh +elif [[ "$RES" == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) + NLAT=354 #106/0.3 +1 + NLON=301 #90/0.3 +1 + STARTLAT=-64.0 + ENDLAT=42 + STARTLON=254.0 + ENDLON=344.0 +elif [[ "$RES" == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) + NLAT=1061 #106/0.1 +1 + NLON=901 #90/0.1 +1 + STARTLAT=-64.0 + ENDLAT=42.0 + STARTLON=254.0 + ENDLON=344.0 +elif [[ "$RES" == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) + NLAT=2121 #106/0.05 +1 + NLON=1801 #90/0.05 +1 + STARTLAT=-64.0 + ENDLAT=42.0 + STARTLON=254.0 + ENDLON=344.0 fi #------------------------------------------------------- @@ -270,7 +286,7 @@ do chmod 755 * hh=${YYYYMMDDHHi:8:2} currentdate=\$(date -d "${YYYYMMDDHHi:0:8} \${hh}:00:00 \$(echo "(\${i}-1)*${t_strout:0:2}" | bc) hours \$(echo "(\${i}-1)*${t_strout:3:2}" | bc) minutes \$(echo "(\${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") - diag_name=MONAN_DIAG_G_MOD_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc + diag_name=MONAN_DIAG_${RORG}_MOD_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc echo "" echo "executando convert mpas" chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Model/* @@ -286,7 +302,7 @@ do i=\$(printf "%04d" \${ii}) hh=${YYYYMMDDHHi:8:2} currentdate=\$(date -d "${YYYYMMDDHHi:0:8} \${hh}:00:00 \$(echo "(\${i}-1)*${t_strout:0:2}" | bc) hours \$(echo "(\${i}-1)*${t_strout:3:2}" | bc) minutes \$(echo "(\${i}-1)*${t_strout:6:2}" | bc) seconds" +"%Y%m%d%H.%M.%S") - diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc + diag_name_post=MONAN_DIAG_${RORG}_POS_${EXP}_${YYYYMMDDHHi}_\${currentdate}.x${RES}L${N_MODEL_LEV}.nc cd ${DIRRUN}/dir.\${i} chmod 755 * diff --git a/scripts/make_degrib_ERA5.bash b/scripts/make_degrib_ERA5.bash index 37c8849..25a92f4 100755 --- a/scripts/make_degrib_ERA5.bash +++ b/scripts/make_degrib_ERA5.bash @@ -1,13 +1,14 @@ #!/bin/bash +umask 022 -if [ $# -ne 6 ] +if [ $# -ne 4 ] then echo "" echo "Instructions: execute the command below" echo "" echo "${0} EXP_NAME RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS" + echo "EXP_NAME :: Forcing: GFS or ERA5" echo " :: Others options to be added later..." echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" @@ -26,6 +27,9 @@ echo "" echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash +echo "" +echo "---- Make Degrib ${EXP} ----" +echo "" # Standart directories variables:--------------------------------------- DIRHOMES=${DIR_SCRIPTS}/scripts_CD-CT; mkdir -p ${DIRHOMES} @@ -39,54 +43,46 @@ EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} # Input variables:-------------------------------------- -EXP=${1}; #EXP=GFS -MESH=${2}; #MESH +EXP=${1}; #EXP=ERA5 +RES=${2}; #RES=1024002 YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 FCST=${4}; #FCST=24 -REGIONAL=${5}; #REGIONAL=Y -LBCINT=${6}; #LBCINT=21600 #------------------------------------------------------- -source utils.bash - # Local variables-------------------------------------- start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 -YYYYMMDDHHf=$(add_hours "$YYYYMMDDHHi" "$FCST") -final_date=${YYYYMMDDHHf:0:4}-${YYYYMMDDHHf:4:2}-${YYYYMMDDHHf:6:2}_${YYYYMMDDHHf:8:2}:00:00 -## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -## !!!!!!!!!!! ATENCAO: AQUI ESTA SENDO ASSUMIDO QUE TODOS OS DADOS DO ERA5 NECESSARIOS PARA O !!!!!!!!!!! -## !!!!!!!!!!! EXPERIMENTO ESTAO NO SEGUINTE DIRETORIO: !!!!!!!!!!! -## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -ERA5_DATA=/pesq/share/monan/curso_OMM_INPE_2025/CGFD-USP_Cases/MPAS-BR/met_data/ERA5/DATA -## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -BNDDIR=${ERA5_DATA} +yyyymmddi=${YYYYMMDDHHi:0:8} +hhi=${YYYYMMDDHHi:8:2} +yyyymmddhhf=$(date +"%Y%m%d%H" -d "${yyyymmddi} ${hhi}:00 ${FCST} hours" ) +final_date=${yyyymmddhhf:0:4}-${yyyymmddhhf:4:2}-${yyyymmddhhf:6:2}_${yyyymmddhhf:8:2}:00:00 export DIRRUN=${DIRHOMED}/run.${YYYYMMDDHHi}; rm -fr ${DIRRUN}; mkdir -p ${DIRRUN} #------------------------------------------------------- mkdir -p ${DATAIN}/${YYYYMMDDHHi} mkdir -p ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs -mkdir -p ${HOME}/local/lib64 -cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 -cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 +if [ "$HOSTNAME" = "egeon" ]; then + mkdir -p ${HOME}/local/lib64 + cp -f /usr/lib64/libjasper.so* ${HOME}/local/lib64 + cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 +fi +BNDDIR=${GCCCIS}/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} -# Se nao existir CI no diretorio ERA5_data, aborta! +# Se nao existir CI no diretorio do GCC MONAN dir /beegfs/monan/CIs (Egeon), /p/projetos/monan_adm/monan/CIs (Jaci) busca em datain/EXP, se não aborta! if [ ! -s ${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib ] || [ ! -s ${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib ] then - echo -e "${RED}==>${NC}Condicao de contorno inexistente !" - echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}" - exit 1 + if [ -s ${DATAIN}/${EXP}/${YYYYMMDDHHi}/era5.pl.${YYYYMMDDHHi}.grib ] || [ ! -s ${DATAIN}/${EXP}/${YYYYMMDDHHi}/era5.sl.${YYYYMMDDHHi}.grib ] + then + echo -e "${RED}==>${NC}Condicao de contorno inexistente! - ${EXP}" + echo -e "${RED}==>${NC}Ciheck ${BNDDIR} or" + echo -e "${RED}==>${NC}Check ${DATAIN}/${EXP}." + exit 1 + else + BNDDIR=${DATAIN}/${EXP}/${YYYYMMDDHHi} + fi fi -## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -## !!!!!!!!!!! ATENCAO: AQUI ESTA SENDO ASSUMIDO QUE A TABELA Vtable.ECMWF EXISTE NESSE DIRETORIO !!!!!!!! -## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -# Copiar Vtable do ERA5 -cp /pesq/share/monan/curso_OMM_INPE_2025/CGFD-USP_Cases/WPS/ungrib/Variable_Tables/Vtable.ECMWF ${DATAIN}/fixed -## !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - -files_needed=("${DATAIN}/fixed/${MESH}.static.nc" "${DATAIN}/fixed/Vtable.ECMWF" "${EXECS}/ungrib.exe" "${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib" "${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib") +files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib" "${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib") for file in "${files_needed[@]}" do if [ ! -s "${file}" ] @@ -98,30 +94,42 @@ do done # Copia arquivos necessarios para diretorio DIRRUN -cp -f ${DATAIN}/fixed/${MESH}.static.nc ${DIRRUN} -cp -f ${DATAIN}/fixed/Vtable.ECMWF ${DIRRUN}/Vtable +cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} +cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE - cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} -rm -f ${DIRRUN}/degrib.bash - -if [[ $REGIONAL == "Y" ]]; then - echo "REGIONAL=Y. Degribbing ERA5 data for both initial and lateral boundary conditions..." - cp -f ${BNDDIR}/era5.pl.*.grib ${DATAIN}/${YYYYMMDDHHi} - cp -f ${BNDDIR}/era5.sl.*.grib ${DATAIN}/${YYYYMMDDHHi} - cat << EOF0 > ${DIRRUN}/degrib.bash -#!/bin/bash -x -#SBATCH --job-name=${DEGRIB_jobname} -#SBATCH --nodes=${DEGRIB_nnodes} -#SBATCH --partition=${DEGRIB_QUEUE} -#SBATCH --ntasks=${DEGRIB_ncores} -#SBATCH --tasks-per-node=${DEGRIB_ncpn} # ic for benchmark -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e%j # File name for standard error output -# +rm -f ${DIRRUN}/degrib_${EXP}.bash + +if [[ $MODERUN == "R" ]]; then + echo "MODERUN=R. Degribbing ERA5 data for both initial and lateral boundary conditions..." + dt=$((LBCINT / 3600)) + for ((hour=0; hour<=FCST; hour+=dt)); do + valid_date=$(date -u -d "${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2} ${YYYYMMDDHHi:8:2}:00:00 UTC ${hour} hour" +"%Y%m%d%H") + echo "Temporarily copying ERA5 data: era5.pl|sl.${valid_date}.grib" + cp -f ${BNDDIR}/era5.pl.${valid_date}.grib ${DATAIN}/${YYYYMMDDHHi} + cp -f ${BNDDIR}/era5.sl.${valid_date}.grib ${DATAIN}/${YYYYMMDDHHi} + done + + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] + then + sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; + s,#NNODES#,${DEGRIB_nnodes},g; + s,#NCPUS#,${DEGRIB_ncpus},g; + s,#NTASKS#,${DEGRIB_ncores},g; + s,#NTASKSPNODE#,${DEGRIB_ncpn},g; + s,#NTHREADS#,${DEGRIB_nthreads},g; + s,#PARTITION#,${DEGRIB_QUEUE},g; + s,#WALLTIME#,${DEGRIB_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib_${EXP}.bash + else + echo "#!/bin/bash " > ${DIRRUN}/degrib_${EXP}.bash + fi + + cat << EOF0 >> ${DIRRUN}/degrib_${EXP}.bash ulimit -s unlimited ulimit -c unlimited @@ -129,26 +137,30 @@ ulimit -v unlimited export PMIX_MCA_gds=hash - export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 cd ${DIRRUN} -. setenv.bash +. ${SCRIPTS}/setenv.bash + +echo "-- PBS_JOBID: \$PBS_JOBID" ldd ungrib.exe rm -f GRIBFILE.* namelist.wps - -sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,ERA5,g" \ +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,${EXP},g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/era5.*.grib +chmod 755 * +echo "" date +echo "submetendo jobs ungrib" + time mpirun -np 1 ./ungrib.exe -date +date grep "Successful completion of program ungrib.exe" ${DIRRUN}/ungrib.log >& /dev/null @@ -165,8 +177,7 @@ fi # mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps - mv ERA5* ${DATAOUT}/${YYYYMMDDHHi}/Pre - + mv ${EXP}* ${DATAOUT}/${YYYYMMDDHHi}/Pre rm -fr ${DATAIN}/${YYYYMMDDHHi} echo "End of degrib Job" @@ -174,22 +185,29 @@ echo "End of degrib Job" EOF0 - -elif [[ $REGIONAL == "N" ]]; then - echo "REGIONAL=N. Degribbing ERA5 data only for initial conditions..." +elif [[ ${MODERUN} == "G" ]]; then + echo "MODERUN=G. Degribbing ERA5 data only for initial conditions..." cp -f ${BNDDIR}/era5.pl.${YYYYMMDDHHi}.grib ${DATAIN}/${YYYYMMDDHHi} cp -f ${BNDDIR}/era5.sl.${YYYYMMDDHHi}.grib ${DATAIN}/${YYYYMMDDHHi} - cat << EOF0 > ${DIRRUN}/degrib.bash -#!/bin/bash -x -#SBATCH --job-name=${DEGRIB_jobname} -#SBATCH --nodes=${DEGRIB_nnodes} -#SBATCH --partition=${DEGRIB_QUEUE} -#SBATCH --ntasks=${DEGRIB_ncores} -#SBATCH --tasks-per-node=${DEGRIB_ncpn} # ic for benchmark -#SBATCH --time=${STATIC_walltime} -#SBATCH --output=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o%j # File name for standard output -#SBATCH --error=${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e%j # File name for standard error output -# + + if [ ${SCHEDULER_SYSTEM} != "GENERIC" ] + then + sed -e "s,#JOBNAME#,${DEGRIB_jobname},g; + s,#NNODES#,${DEGRIB_nnodes},g; + s,#NCPUS#,${DEGRIB_ncpus},g; + s,#NTASKS#,${DEGRIB_ncores},g; + s,#NTASKSPNODE#,${DEGRIB_ncpn},g; + s,#NTHREADS#,${DEGRIB_nthreads},g; + s,#PARTITION#,${DEGRIB_QUEUE},g; + s,#WALLTIME#,${DEGRIB_walltime},g; + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib_${EXP}.bash + else + echo "#!/bin/bash " > ${DIRRUN}/degrib_${EXP}.bash + fi + + cat << EOF0 >> ${DIRRUN}/degrib_${EXP}.bash ulimit -s unlimited ulimit -c unlimited @@ -197,26 +215,30 @@ ulimit -v unlimited export PMIX_MCA_gds=hash - export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${HOME}/local/lib64 cd ${DIRRUN} . setenv.bash +echo "-- PBS_JOBID: \$PBS_JOBID" + ldd ungrib.exe rm -f GRIBFILE.* namelist.wps - -sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,ERA5,g" \ +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,${EXP},g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/era5.*.${YYYYMMDDHHi}.grib +chmod 755 * +echo "" date +echo "submetendo jobs ungrib" + time mpirun -np 1 ./ungrib.exe -date +date grep "Successful completion of program ungrib.exe" ${DIRRUN}/ungrib.log >& /dev/null @@ -233,8 +255,7 @@ fi # mv ungrib.log ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/ungrib.${start_date}.log mv namelist.wps ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/namelist.${start_date}.wps - mv ERA5\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre - + mv ${EXP}\:${start_date:0:13} ${DATAOUT}/${YYYYMMDDHHi}/Pre rm -fr ${DATAIN}/${YYYYMMDDHHi} echo "End of degrib Job" @@ -244,19 +265,29 @@ EOF0 else echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} LBCs phase fails during degrib! Please select REGIONAL=Y or REGIONAL=N so that degrib can be done appropriately.\n" + echo -e "${RED}==>${NC} Make degrib phase fails during degrib! Please select REGIONAL=Y or REGIONAL=N so that degrib can be done appropriately.\n" echo -e "${RED}==>${NC} Exiting script. \n" exit -1 fi - -chmod a+x ${DIRRUN}/degrib.bash - -echo -e "${GREEN}==>${NC} Executing sbatch degrib.bash...\n" -cd ${DIRRUN} -sbatch --wait ${DIRRUN}/degrib.bash - - +chmod a+x ${DIRRUN}/degrib_${EXP}.bash + +case "${SCHEDULER_SYSTEM}" in + SLURM) + echo -e "${GREEN}==>${NC} Sbatch degrib_${EXP}.bash...\n" + cd ${DIRRUN} + sbatch --wait ${DIRRUN}/degrib_${EXP}.bash + ;; + PBS) + echo -e "${GREEN}==>${NC} Qsub degrib_${EXP}.bash...\n" + cd ${DIRRUN} + qsub -W block=true ${DIRRUN}/degrib_${EXP}.bash + ;; +# GENERIC) +# echo "Nenhum gerenciador detectado" +# ${DIRRUN}/degrib_${EXP}.bash +# ;; +esac files_ungrib=("${EXP}:${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}") for file in "${files_ungrib[@]}" @@ -271,5 +302,12 @@ do fi done -mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +mv ${DIRRUN}/degrib_${EXP}.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* + +JOBID=$(sed -n '4p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o.${JOBID} +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e.${JOBID} rm -fr ${DIRRUN} diff --git a/scripts/make_degrib_GFS.bash b/scripts/make_degrib_GFS.bash index b9533b3..abe6f9c 100755 --- a/scripts/make_degrib_GFS.bash +++ b/scripts/make_degrib_GFS.bash @@ -9,7 +9,7 @@ then echo "" echo "${0} EXP_NAME RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS" + echo "EXP_NAME :: Forcing: GFS or ERA5" echo " :: Others options to be added later..." echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" @@ -29,7 +29,7 @@ echo -e "\033[1;32m==>\033[0m Moduling environment for MONAN model...\n" . setenv.bash echo "" -echo "---- Make Degrib ----" +echo "---- Make Degrib ${EXP} ----" echo "" # Standart directories variables:--------------------------------------- @@ -42,7 +42,6 @@ SOURCES=${DIRHOMES}/sources; mkdir -p ${SOURCES} EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} #---------------------------------------------------------------------- - # Input variables:-------------------------------------- EXP=${1}; #EXP=GFS RES=${2}; #RES=1024002 @@ -50,7 +49,6 @@ YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 FCST=${4}; #FCST=24 #------------------------------------------------------- - # Local variables-------------------------------------- start_date=${YYYYMMDDHHi:0:4}-${YYYYMMDDHHi:4:2}-${YYYYMMDDHHi:6:2}_${YYYYMMDDHHi:8:2}:00:00 yyyymmddi=${YYYYMMDDHHi:0:8} @@ -68,34 +66,31 @@ if [ "$HOSTNAME" = "egeon" ]; then cp -f /usr/lib64/libjpeg.so* ${HOME}/local/lib64 fi -#Se nao existir CI no diretorio do IO, -# busca no nosso dir /beegfs/monan/CIs, se nao existir tbm, aborta! -#CR: BNDDIR should be setted just for EGEON machine -#CR: some local variables were mobed into the SLURM section, particularly for egeon - OPERDIREXP=${OPERDIR}/${EXP} BNDDIR=${OPERDIREXP}/0p25/brutos/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi:4:2}/${YYYYMMDDHHi:6:2}/${YYYYMMDDHHi:8:2} - -# Se nao existir CI no diretorio do IO, -# busca no nosso dir /beegfs/monan/CIs (Egeon) , /p/monan/CIs (xd2000) se nao existir tbm, aborta! +# Se nao existir CI no diretorio do IO, busca no GCC MONAN dir /beegfs/monan/CIs (Egeon), /p/projetos/monan_adm/monan/CIs +# Se nao existir tambem no GCC MONAN, busca em datain/EXP, se não aborta! #CR: maybe this if should belong to the SLURM kind of running... if [ ! -s ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] then if [ ! -s ${GCCCIS}/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] then - echo -e "${RED}==>${NC}Condicao de contorno inexistente !" - echo -e "${RED}==>${NC}Check ${BNDDIR} or." - echo -e "${RED}==>${NC}Check ${GCCCIS}/${EXP}" - exit 1 - else + if [ -s ${DATAIN}/${EXP}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ] + then + echo -e "${RED}==>${NC}Condicao de contorno inexistente! - ${EXP}" + echo -e "${RED}==>${NC}Check ${BNDDIR} or" + echo -e "${RED}==>${NC}Check ${GCCCIS}/${EXP} or" + echo -e "${RED}==>${NC}Check ${DATAIN}/${EXP}." + exit 1 + else + BNDDIR=${DATAIN}/${EXP}/${YYYYMMDDHHi} + fi + else BNDDIR=${GCCCIS}/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} fi fi - -#files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") - files_needed=("${DATAIN}/fixed/x1.${RES}.static.nc" "${DATAIN}/fixed/Vtable.${EXP}" "${EXECS}/ungrib.exe" "${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2") for file in "${files_needed[@]}" @@ -112,11 +107,9 @@ cp -f ${DATAIN}/fixed/x1.${RES}.static.nc ${DIRRUN} cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN}/Vtable cp -f ${EXECS}/ungrib.exe ${DIRRUN} cp -f ${SCRIPTS}/namelists/namelist.wps.TEMPLATE ${DIRRUN}/namelist.wps.TEMPLATE -#cp -f ${BNDDIR}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DATAIN}/${YYYYMMDDHHi} -#cp -f ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 ${DIRRUN} cp -f ${SCRIPTS}/setenv.bash ${DIRRUN} cp -f ${SCRIPTS}/link_grib.csh ${DIRRUN} -rm -f ${DIRRUN}/degrib.bash +rm -f ${DIRRUN}/degrib_${EXP}.bash if [[ $MODERUN == "R" ]]; then echo "MODERUN=R. Degribbing GFS data for both initial and lateral boundary conditions..." @@ -138,14 +131,14 @@ if [[ $MODERUN == "R" ]]; then s,#NTHREADS#,${DEGRIB_nthreads},g; s,#PARTITION#,${DEGRIB_QUEUE},g; s,#WALLTIME#,${DEGRIB_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ - ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib.bash + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib_${EXP}.bash else - echo "#!/bin/bash " > ${DIRRUN}/degrib.bash + echo "#!/bin/bash " > ${DIRRUN}/degrib_${EXP}.bash fi - cat << EOF0 >> ${DIRRUN}/degrib.bash + cat << EOF0 >> ${DIRRUN}/degrib_${EXP}.bash ulimit -s unlimited ulimit -c unlimited @@ -165,7 +158,7 @@ ldd ungrib.exe rm -f GRIBFILE.* namelist.wps -sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,GFS,g" \ +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${final_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,${EXP},g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps echo "" @@ -216,14 +209,14 @@ elif [[ $MODERUN == "G" ]]; then s,#NTHREADS#,${DEGRIB_nthreads},g; s,#PARTITION#,${DEGRIB_QUEUE},g; s,#WALLTIME#,${DEGRIB_walltime},g; - s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o,g; - s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e,g" \ - ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib.bash + s,#OUTPUTJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o,g; + s,#ERRORJOB#,${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e,g" \ + ${SCRIPTS}/stools/submit_${SYSTEM_KEY}.bash_TEMPLATE > ${DIRRUN}/degrib_${EXP}.bash else - echo "#!/bin/bash " > ${DIRRUN}/degrib.bash + echo "#!/bin/bash " > ${DIRRUN}/degrib_${EXP}.bash fi - cat << EOF0 >> ${DIRRUN}/degrib.bash + cat << EOF0 >> ${DIRRUN}/degrib_${EXP}.bash ulimit -s unlimited ulimit -c unlimited @@ -243,7 +236,7 @@ ldd ungrib.exe rm -f GRIBFILE.* namelist.wps -sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,GFS,g" \ +sed -e "s,#LABELI#,${start_date},g;s,#LABELF#,${start_date},g;s,#LBCINT#,${LBCINT},g;s,#PREFIX#,${EXP},g" \ ${DIRRUN}/namelist.wps.TEMPLATE > ${DIRRUN}/namelist.wps ./link_grib.csh ${DATAIN}/${YYYYMMDDHHi}/gfs.t${YYYYMMDDHHi:8:2}z.pgrb2.0p25.f000.${YYYYMMDDHHi}.grib2 @@ -278,27 +271,27 @@ EOF0 else echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" - echo -e "${RED}==>${NC} LBCs phase fails during degrib! Please select MODERUN=R or G so that degrib can be done appropriately.\n" + echo -e "${RED}==>${NC} Make degrib phase fails during degrib! Please select MODERUN=R or G so that degrib can be done appropriately.\n" echo -e "${RED}==>${NC} Exiting script. \n" exit -1 fi -chmod a+x ${DIRRUN}/degrib.bash +chmod a+x ${DIRRUN}/degrib_${EXP}.bash case "${SCHEDULER_SYSTEM}" in SLURM) - echo -e "${GREEN}==>${NC} Sbatch degrib.bash...\n" + echo -e "${GREEN}==>${NC} Sbatch degrib_${EXP}.bash...\n" cd ${DIRRUN} - sbatch --wait ${DIRRUN}/degrib.bash + sbatch --wait ${DIRRUN}/degrib_${EXP}.bash ;; PBS) - echo -e "${GREEN}==>${NC} qsub degrib.bash...\n" + echo -e "${GREEN}==>${NC} Qsub degrib_${EXP}.bash...\n" cd ${DIRRUN} - qsub -W block=true ${DIRRUN}/degrib.bash + qsub -W block=true ${DIRRUN}/degrib_${EXP}.bash ;; # GENERIC) # echo "Nenhum gerenciador detectado" -# ${DIRRUN}/degrib.bash +# ${DIRRUN}/degrib_${EXP}.bash # ;; esac @@ -316,12 +309,12 @@ do fi done -mv ${DIRRUN}/degrib.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +mv ${DIRRUN}/degrib_GFS.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* -JOBID=$(sed -n '4p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o | awk '{print $3}' | sed "s/.pbs-ha//g") -mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o.${JOBID} -mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e.${JOBID} -chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.o.${JOBID} -chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib.e.${JOBID} +JOBID=$(sed -n '4p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o | awk '{print $3}' | sed "s/.pbs-ha//g") +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o.${JOBID} +mv ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o.${JOBID} +chmod a+r ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.e.${JOBID} rm -fr ${DIRRUN} diff --git a/scripts/make_initatmos.bash b/scripts/make_initatmos.bash index 2228f0b..a321301 100755 --- a/scripts/make_initatmos.bash +++ b/scripts/make_initatmos.bash @@ -66,14 +66,12 @@ then echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" cd ${DATAIN}/fixed wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz + rm -fr x1.${RES}.tar.gz fi diff --git a/scripts/make_lbcs.bash b/scripts/make_lbcs.bash index 37de28f..939da66 100755 --- a/scripts/make_lbcs.bash +++ b/scripts/make_lbcs.bash @@ -65,14 +65,12 @@ then echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" cd ${DATAIN}/fixed wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz + rm -fr x1.${RES}.tar.gz fi files_needed=("${SCRIPTS}/namelists/namelist.init_atmosphere.LBCS" "${SCRIPTS}/namelists/streams.init_atmosphere.LBCS" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAOUT}/${YYYYMMDDHHi}/Pre/x1.${RES}.init.nc" "${EXECS}/init_atmosphere_model") diff --git a/scripts/make_static.bash b/scripts/make_static.bash index e38061a..c59eba8 100755 --- a/scripts/make_static.bash +++ b/scripts/make_static.bash @@ -67,16 +67,14 @@ then cd ${DATAIN}/fixed echo -e "${GREEN}==>${NC} downloading meshes tgz files ... \n" wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}.tar.gz - wget https://www2.mmm.ucar.edu/projects/mpas/atmosphere_meshes/x1.${RES}_static.tar.gz tar -xzvf x1.${RES}.tar.gz - tar -xzvf x1.${RES}_static.tar.gz chmod 755 * fi echo -e "${GREEN}==>${NC} Creating x1.${RES}.graph.info.part.${cores} ... \n" cd ${DATAIN}/fixed gpmetis -minconn -contig -niter=200 x1.${RES}.graph.info ${cores} - rm -fr x1.${RES}.tar.gz x1.${RES}_static.tar.gz chmod 755 * + rm -fr x1.${RES}.tar.gz fi files_needed=("${EXECS}/init_atmosphere_model" "${DATAIN}/fixed/x1.${RES}.graph.info.part.${cores}" "${DATAIN}/fixed/x1.${RES}.grid.nc" "${SCRIPTS}/namelists/namelist.init_atmosphere.STATIC" "${SCRIPTS}/namelists/streams.init_atmosphere.STATIC") diff --git a/scripts/make_template.bash b/scripts/make_template.bash index b1983ec..c95c821 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -23,7 +23,7 @@ then echo "" echo "${0} ]EXP_NAME/OP] RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS" + echo "EXP_NAME :: Forcing: GFS or ERA5" echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." @@ -89,92 +89,6 @@ cd ${DIRRUN} IFS=":" read -r h m s <<< "${t_strout}" printf -v t_strout "%02d:%02d:%02d" "$h" "$m" "$s" -# Calculating default parameters for different resolutions -if [[ $MODERUN == "G" ]]; then - if [ $RES -eq 40962 ]; then #120Km - NLAT=151 #180/1.2 - NLON=301 #360/1.2 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 163842 ]; then #60Km - NLAT=301 #180/0.6 - NLON=601 #360/0.6 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 655362 ]; then #30Km - NLAT=601 #180/0.3 - NLON=1201 #360/0.3 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 1024002 ]; then #24Km - NLAT=721 #180/0.25 - NLON=1441 #360/0.25 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 2621442 ]; then #15Km - NLAT=1201 #180/0.15 - NLON=2401 #360/0.15 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 5898242 ]; then #10Km - NLAT=1801 #180/0.10 (+1) - NLON=3601 #360/0.10 (+1) - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 23592962 ]; then #5Km - NLAT=3601 #180/0.05 - NLON=7201 #360/0.05 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - elif [ $RES -eq 65536002 ]; then #3Km - NLAT=6001 #180/0.03 - NLON=12001 #360/0.03 - STARTLAT=-90.0 - STARTLON=0.0 - ENDLAT=90.0 - ENDLON=360.0 - fi -elif [[ $MODERUN == "R" ]]; then - if [[ "$RES" == "655362.REG.AMS_CAR" ]]; then #30 km (AMS + Caribe) - NLAT=368 #110/0.3 +1 - NLON=334 #100/0.3 +1 - STARTLAT=-65.0 - ENDLAT=40 - STARTLON=240.0 - ENDLON=340.0 - elif [[ $RES == "5898242.REG.AMS_CAR" ]]; then #10 km (AMS + Caribe) - NLAT=1101 #110/0.1 + 1 - NLON=1001 #100/0.1 + 1 - STARTLAT=-70.0 - ENDLAT=40.0 - STARTLON=240.0 - ENDLON=340.0 - elif [[ $RES == "23592962.REG.AMS_CAR" ]]; then #5 km (AMS + Caribe) - NLAT=2201 #110/0.05 + 1 - NLON=2001 #100/0.05 + 1 - STARTLAT=-70.0 - ENDLAT=40.0 - STARTLON=240.0 - ENDLON=340.0 - fi -fi - -#------------------------------------------------------- - # NLEVS get from t_iso_levels in Registry_isobaric.xml: if [ -s ${MONANDIR}/src/core_atmosphere/diagnostics/Registry_isobaric.xml ] then @@ -186,9 +100,20 @@ fi output_interval=${t_strouthor} nfiles=$(echo "$FCST/$output_interval + 1" | bc) -diag_name_post=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_${YYYYMMDDHHi}.00.00.x${RES}L${N_MODEL_LEV}.nc -diag_name_templ=MONAN_DIAG_G_POS_${EXP}_${YYYYMMDDHHi}_%y4%m2%d2%h2.%n2.00.x${RES}L${N_MODEL_LEV}.nc +# Definindo G ou R no MONAN_DIAG +if [[ $MODERUN == "R" ]]; then + RORG=R +elif [[ $MODERUN == "G" ]]; then + RORG=G +else + echo -e "\n${RED}==>${NC} ***** ATTENTION *****\n" + echo -e "${RED}==>${NC} Make post template phase fails! Please select MODERUN=R (Regional) or MODERUN=G (Global) in 'setenv.bash'.\n" + echo -e "${RED}==>${NC} Exiting script. \n" + exit -1 +fi +diag_name_post=MONAN_DIAG_${RORG}_POS_${EXP}_${YYYYMMDDHHi}_${YYYYMMDDHHi}.00.00.x${RES}L${N_MODEL_LEV}.nc +diag_name_templ=MONAN_DIAG_${RORG}_POS_${EXP}_${YYYYMMDDHHi}_%y4%m2%d2%h2.%n2.00.x${RES}L${N_MODEL_LEV}.nc rm -fr ${DIRRUN}/qctlinfo.gs diff --git a/scripts/namelists/include_fields.diag b/scripts/namelists/include_fields.diag deleted file mode 100755 index b39754f..0000000 --- a/scripts/namelists/include_fields.diag +++ /dev/null @@ -1,72 +0,0 @@ -initial_time -xtime -Time -t_iso_levels -zgeo_isobaric -cldfrac_isobaric -temperature_isobaric -dewpoint_isobaric -relhum_isobaric -w_isobaric -uzonal_isobaric -umeridional_isobaric -vorticity_isobaric -height_isobaric -spechum_isobaric -omega_isobaric -rqvblten_isobaric -rthblten_isobaric -rqvcuten_isobaric -rthcuten_isobaric -rthratenlw_isobaric -rthratensw_isobaric -rucuten_isobaric -rvcuten_isobaric -rvblten_isobaric -rublten_isobaric -kzq_isobaric -kzh_isobaric -kzm_isobaric -ni_isobaric -nr_isobaric -qr_isobaric -qs_isobaric -qv_isobaric -qc_isobaric -qg_isobaric -qi_isobaric -t2m -rainc -rainnc -uzonal_surface -umeridional_surface -u10 -v10 -surface_pressure -sst -q2 -mslp -lh -hpbl -hfx -delta -cldfrac_tot_UPP -chs -cd -acswuptc -acswupt -acswupbc -acswupb -acswdntc -acswdnt -acswdnbc -acswdnb -acsnow -aclwuptc -aclwupt -aclwupbc -aclwupb -aclwdntc -aclwdnt -aclwdnbc -aclwdnb diff --git a/scripts/namelists/include_fields.diag.CD-CT b/scripts/namelists/include_fields.diag.CD-CT deleted file mode 100755 index 3de9759..0000000 --- a/scripts/namelists/include_fields.diag.CD-CT +++ /dev/null @@ -1,695 +0,0 @@ -t2m -rainc -rainnc -uzonal_surface -umeridional_surface -u10 -v10 -surface_pressure -relhum_15hPa -relhum_20hPa -relhum_30hPa -relhum_50hPa -relhum_70hPa -relhum_100hPa -relhum_150hPa -relhum_200hPa -relhum_250hPa -relhum_300hPa -relhum_400hPa -relhum_500hPa -relhum_600hPa -relhum_700hPa -relhum_825hPa -relhum_850hPa -relhum_875hPa -relhum_900hPa -relhum_925hPa -relhum_950hPa -relhum_975hPa -relhum_1000hPa -geoph_15hPa -geoph_20hPa -geoph_30hPa -geoph_50hPa -geoph_70hPa -geoph_100hPa -geoph_150hPa -geoph_200hPa -geoph_250hPa -geoph_300hPa -geoph_400hPa -geoph_500hPa -geoph_600hPa -geoph_700hPa -geoph_825hPa -geoph_850hPa -geoph_875hPa -geoph_900hPa -geoph_925hPa -geoph_950hPa -geoph_975hPa -geoph_1000hPa -sst -q2 -mslp -lh -hpbl -hfx -delta -cldfrac_tot_UPP -chs -cd -acswuptc -acswupt -acswupbc -acswupb -acswdntc -acswdnt -acswdnbc -acswdnb -acsnow -aclwuptc -aclwupt -aclwupbc -aclwupb -aclwdntc -aclwdnt -aclwdnbc -aclwdnb -w_15hPa -w_20hPa -w_30hPa -w_50hPa -w_70hPa -w_100hPa -w_150hPa -w_200hPa -w_250hPa -w_300hPa -w_400hPa -w_500hPa -w_600hPa -w_700hPa -w_825hPa -w_850hPa -w_875hPa -w_900hPa -w_925hPa -w_950hPa -w_975hPa -w_1000hPa -uzonal_15hPa -uzonal_20hPa -uzonal_30hPa -uzonal_50hPa -uzonal_70hPa -uzonal_100hPa -uzonal_150hPa -uzonal_200hPa -uzonal_250hPa -uzonal_300hPa -uzonal_400hPa -uzonal_500hPa -uzonal_600hPa -uzonal_700hPa -uzonal_825hPa -uzonal_850hPa -uzonal_875hPa -uzonal_900hPa -uzonal_925hPa -uzonal_950hPa -uzonal_975hPa -uzonal_1000hPa -umeridional_15hPa -umeridional_20hPa -umeridional_30hPa -umeridional_50hPa -umeridional_70hPa -umeridional_100hPa -umeridional_150hPa -umeridional_200hPa -umeridional_250hPa -umeridional_300hPa -umeridional_400hPa -umeridional_500hPa -umeridional_600hPa -umeridional_700hPa -umeridional_825hPa -umeridional_850hPa -umeridional_875hPa -umeridional_900hPa -umeridional_925hPa -umeridional_950hPa -umeridional_975hPa -umeridional_1000hPa -temperature_15hPa -temperature_20hPa -temperature_30hPa -temperature_50hPa -temperature_70hPa -temperature_100hPa -temperature_150hPa -temperature_200hPa -temperature_250hPa -temperature_300hPa -temperature_400hPa -temperature_500hPa -temperature_600hPa -temperature_700hPa -temperature_825hPa -temperature_850hPa -temperature_875hPa -temperature_900hPa -temperature_925hPa -temperature_950hPa -temperature_975hPa -temperature_1000hPa -spechum_15hPa -spechum_20hPa -spechum_30hPa -spechum_50hPa -spechum_70hPa -spechum_100hPa -spechum_150hPa -spechum_200hPa -spechum_250hPa -spechum_300hPa -spechum_400hPa -spechum_500hPa -spechum_600hPa -spechum_700hPa -spechum_825hPa -spechum_850hPa -spechum_875hPa -spechum_900hPa -spechum_925hPa -spechum_950hPa -spechum_975hPa -spechum_1000hPa -rthratenlw_15hPa -rthratenlw_20hPa -rthratenlw_30hPa -rthratenlw_50hPa -rthratenlw_70hPa -rthratenlw_100hPa -rthratenlw_150hPa -rthratenlw_200hPa -rthratenlw_250hPa -rthratenlw_300hPa -rthratenlw_400hPa -rthratenlw_500hPa -rthratenlw_600hPa -rthratenlw_700hPa -rthratenlw_825hPa -rthratenlw_850hPa -rthratenlw_875hPa -rthratenlw_900hPa -rthratenlw_925hPa -rthratenlw_950hPa -rthratenlw_975hPa -rthratenlw_1000hPa -rqvcuten_15hPa -rqvcuten_20hPa -rqvcuten_30hPa -rqvcuten_50hPa -rqvcuten_70hPa -rqvcuten_100hPa -rqvcuten_150hPa -rqvcuten_200hPa -rqvcuten_250hPa -rqvcuten_300hPa -rqvcuten_400hPa -rqvcuten_500hPa -rqvcuten_600hPa -rqvcuten_700hPa -rqvcuten_825hPa -rqvcuten_850hPa -rqvcuten_875hPa -rqvcuten_900hPa -rqvcuten_925hPa -rqvcuten_950hPa -rqvcuten_975hPa -rqvcuten_1000hPa -rqvblten_15hPa -rqvblten_20hPa -rqvblten_30hPa -rqvblten_50hPa -rqvblten_70hPa -rqvblten_100hPa -rqvblten_150hPa -rqvblten_200hPa -rqvblten_250hPa -rqvblten_300hPa -rqvblten_400hPa -rqvblten_500hPa -rqvblten_600hPa -rqvblten_700hPa -rqvblten_825hPa -rqvblten_850hPa -rqvblten_875hPa -rqvblten_900hPa -rqvblten_925hPa -rqvblten_950hPa -rqvblten_975hPa -rqvblten_1000hPa -kzh_15hPa -kzh_20hPa -kzh_30hPa -kzh_50hPa -kzh_70hPa -kzh_100hPa -kzh_150hPa -kzh_200hPa -kzh_250hPa -kzh_300hPa -kzh_400hPa -kzh_500hPa -kzh_600hPa -kzh_700hPa -kzh_825hPa -kzh_850hPa -kzh_875hPa -kzh_900hPa -kzh_925hPa -kzh_950hPa -kzh_975hPa -kzh_1000hPa -kzm_15hPa -kzm_20hPa -kzm_30hPa -kzm_50hPa -kzm_70hPa -kzm_100hPa -kzm_150hPa -kzm_200hPa -kzm_250hPa -kzm_300hPa -kzm_400hPa -kzm_500hPa -kzm_600hPa -kzm_700hPa -kzm_825hPa -kzm_850hPa -kzm_875hPa -kzm_900hPa -kzm_925hPa -kzm_950hPa -kzm_975hPa -kzm_1000hPa -kzq_15hPa -kzq_20hPa -kzq_30hPa -kzq_50hPa -kzq_70hPa -kzq_100hPa -kzq_150hPa -kzq_200hPa -kzq_250hPa -kzq_300hPa -kzq_400hPa -kzq_500hPa -kzq_600hPa -kzq_700hPa -kzq_825hPa -kzq_850hPa -kzq_875hPa -kzq_900hPa -kzq_925hPa -kzq_950hPa -kzq_975hPa -kzq_1000hPa -height_15hPa -height_20hPa -height_30hPa -height_50hPa -height_70hPa -height_100hPa -height_150hPa -height_200hPa -height_250hPa -height_300hPa -height_400hPa -height_500hPa -height_600hPa -height_700hPa -height_825hPa -height_850hPa -height_875hPa -height_900hPa -height_925hPa -height_950hPa -height_975hPa -height_1000hPa -qc_15hPa -qc_20hPa -qc_30hPa -qc_50hPa -qc_70hPa -qc_100hPa -qc_150hPa -qc_200hPa -qc_250hPa -qc_300hPa -qc_400hPa -qc_500hPa -qc_600hPa -qc_700hPa -qc_825hPa -qc_850hPa -qc_875hPa -qc_900hPa -qc_925hPa -qc_950hPa -qc_975hPa -qc_1000hPa -qg_15hPa -qg_20hPa -qg_30hPa -qg_50hPa -qg_70hPa -qg_100hPa -qg_150hPa -qg_200hPa -qg_250hPa -qg_300hPa -qg_400hPa -qg_500hPa -qg_600hPa -qg_700hPa -qg_825hPa -qg_850hPa -qg_875hPa -qg_900hPa -qg_925hPa -qg_950hPa -qg_975hPa -qg_1000hPa -qi_15hPa -qi_20hPa -qi_30hPa -qi_50hPa -qi_70hPa -qi_100hPa -qi_150hPa -qi_200hPa -qi_250hPa -qi_300hPa -qi_400hPa -qi_500hPa -qi_600hPa -qi_700hPa -qi_825hPa -qi_850hPa -qi_875hPa -qi_900hPa -qi_925hPa -qi_950hPa -qi_975hPa -qi_1000hPa -qv_15hPa -qv_20hPa -qv_30hPa -qv_50hPa -qv_70hPa -qv_100hPa -qv_150hPa -qv_200hPa -qv_250hPa -qv_300hPa -qv_400hPa -qv_500hPa -qv_600hPa -qv_700hPa -qv_825hPa -qv_850hPa -qv_875hPa -qv_900hPa -qv_925hPa -qv_950hPa -qv_975hPa -qv_1000hPa -qr_15hPa -qr_20hPa -qr_30hPa -qr_50hPa -qr_70hPa -qr_100hPa -qr_150hPa -qr_200hPa -qr_250hPa -qr_300hPa -qr_400hPa -qr_500hPa -qr_600hPa -qr_700hPa -qr_825hPa -qr_850hPa -qr_875hPa -qr_900hPa -qr_925hPa -qr_950hPa -qr_975hPa -qr_1000hPa -qs_15hPa -qs_20hPa -qs_30hPa -qs_50hPa -qs_70hPa -qs_100hPa -qs_150hPa -qs_200hPa -qs_250hPa -qs_300hPa -qs_400hPa -qs_500hPa -qs_600hPa -qs_700hPa -qs_825hPa -qs_850hPa -qs_875hPa -qs_900hPa -qs_925hPa -qs_950hPa -qs_975hPa -qs_1000hPa -ni_15hPa -ni_20hPa -ni_30hPa -ni_50hPa -ni_70hPa -ni_100hPa -ni_150hPa -ni_200hPa -ni_250hPa -ni_300hPa -ni_400hPa -ni_500hPa -ni_600hPa -ni_700hPa -ni_825hPa -ni_850hPa -ni_875hPa -ni_900hPa -ni_925hPa -ni_950hPa -ni_975hPa -ni_1000hPa -nr_15hPa -nr_20hPa -nr_30hPa -nr_50hPa -nr_70hPa -nr_100hPa -nr_150hPa -nr_200hPa -nr_250hPa -nr_300hPa -nr_400hPa -nr_500hPa -nr_600hPa -nr_700hPa -nr_825hPa -nr_850hPa -nr_875hPa -nr_900hPa -nr_925hPa -nr_950hPa -nr_975hPa -nr_1000hPa -rucuten_15hPa -rucuten_20hPa -rucuten_30hPa -rucuten_50hPa -rucuten_70hPa -rucuten_100hPa -rucuten_150hPa -rucuten_200hPa -rucuten_250hPa -rucuten_300hPa -rucuten_400hPa -rucuten_500hPa -rucuten_600hPa -rucuten_700hPa -rucuten_825hPa -rucuten_850hPa -rucuten_875hPa -rucuten_900hPa -rucuten_925hPa -rucuten_950hPa -rucuten_975hPa -rucuten_1000hPa -rvcuten_15hPa -rvcuten_20hPa -rvcuten_30hPa -rvcuten_50hPa -rvcuten_70hPa -rvcuten_100hPa -rvcuten_150hPa -rvcuten_200hPa -rvcuten_250hPa -rvcuten_300hPa -rvcuten_400hPa -rvcuten_500hPa -rvcuten_600hPa -rvcuten_700hPa -rvcuten_825hPa -rvcuten_850hPa -rvcuten_875hPa -rvcuten_900hPa -rvcuten_925hPa -rvcuten_950hPa -rvcuten_975hPa -rvcuten_1000hPa -rvblten_15hPa -rvblten_20hPa -rvblten_30hPa -rvblten_50hPa -rvblten_70hPa -rvblten_100hPa -rvblten_150hPa -rvblten_200hPa -rvblten_250hPa -rvblten_300hPa -rvblten_400hPa -rvblten_500hPa -rvblten_600hPa -rvblten_700hPa -rvblten_825hPa -rvblten_850hPa -rvblten_875hPa -rvblten_900hPa -rvblten_925hPa -rvblten_950hPa -rvblten_975hPa -rvblten_1000hPa -cldfrac_15hPa -cldfrac_20hPa -cldfrac_30hPa -cldfrac_50hPa -cldfrac_70hPa -cldfrac_100hPa -cldfrac_150hPa -cldfrac_200hPa -cldfrac_250hPa -cldfrac_300hPa -cldfrac_400hPa -cldfrac_500hPa -cldfrac_600hPa -cldfrac_700hPa -cldfrac_825hPa -cldfrac_850hPa -cldfrac_875hPa -cldfrac_900hPa -cldfrac_925hPa -cldfrac_950hPa -cldfrac_975hPa -cldfrac_1000hPa -rublten_15hPa -rublten_20hPa -rublten_30hPa -rublten_50hPa -rublten_70hPa -rublten_100hPa -rublten_150hPa -rublten_200hPa -rublten_250hPa -rublten_300hPa -rublten_400hPa -rublten_500hPa -rublten_600hPa -rublten_700hPa -rublten_825hPa -rublten_850hPa -rublten_875hPa -rublten_900hPa -rublten_925hPa -rublten_950hPa -rublten_975hPa -rublten_1000hPa -rthratensw_15hPa -rthratensw_20hPa -rthratensw_30hPa -rthratensw_50hPa -rthratensw_70hPa -rthratensw_100hPa -rthratensw_150hPa -rthratensw_200hPa -rthratensw_250hPa -rthratensw_300hPa -rthratensw_400hPa -rthratensw_500hPa -rthratensw_600hPa -rthratensw_700hPa -rthratensw_825hPa -rthratensw_850hPa -rthratensw_875hPa -rthratensw_900hPa -rthratensw_925hPa -rthratensw_950hPa -rthratensw_975hPa -rthratensw_1000hPa -omega_15hPa -omega_20hPa -omega_30hPa -omega_50hPa -omega_70hPa -omega_100hPa -omega_150hPa -omega_200hPa -omega_250hPa -omega_300hPa -omega_400hPa -omega_500hPa -omega_600hPa -omega_700hPa -omega_825hPa -omega_850hPa -omega_875hPa -omega_900hPa -omega_925hPa -omega_950hPa -omega_975hPa -omega_1000hPa -zgeo_15hPa -zgeo_20hPa -zgeo_30hPa -zgeo_50hPa -zgeo_70hPa -zgeo_100hPa -zgeo_150hPa -zgeo_200hPa -zgeo_250hPa -zgeo_300hPa -zgeo_400hPa -zgeo_500hPa -zgeo_600hPa -zgeo_700hPa -zgeo_825hPa -zgeo_850hPa -zgeo_875hPa -zgeo_900hPa -zgeo_925hPa -zgeo_950hPa -zgeo_975hPa -zgeo_1000hPa diff --git a/scripts/namelists/include_fields.diag.GCC b/scripts/namelists/include_fields.diag.GCC deleted file mode 100755 index b39754f..0000000 --- a/scripts/namelists/include_fields.diag.GCC +++ /dev/null @@ -1,72 +0,0 @@ -initial_time -xtime -Time -t_iso_levels -zgeo_isobaric -cldfrac_isobaric -temperature_isobaric -dewpoint_isobaric -relhum_isobaric -w_isobaric -uzonal_isobaric -umeridional_isobaric -vorticity_isobaric -height_isobaric -spechum_isobaric -omega_isobaric -rqvblten_isobaric -rthblten_isobaric -rqvcuten_isobaric -rthcuten_isobaric -rthratenlw_isobaric -rthratensw_isobaric -rucuten_isobaric -rvcuten_isobaric -rvblten_isobaric -rublten_isobaric -kzq_isobaric -kzh_isobaric -kzm_isobaric -ni_isobaric -nr_isobaric -qr_isobaric -qs_isobaric -qv_isobaric -qc_isobaric -qg_isobaric -qi_isobaric -t2m -rainc -rainnc -uzonal_surface -umeridional_surface -u10 -v10 -surface_pressure -sst -q2 -mslp -lh -hpbl -hfx -delta -cldfrac_tot_UPP -chs -cd -acswuptc -acswupt -acswupbc -acswupb -acswdntc -acswdnt -acswdnbc -acswdnb -acsnow -aclwuptc -aclwupt -aclwupbc -aclwupb -aclwdntc -aclwdnt -aclwdnbc -aclwdnb diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics b/scripts/namelists/stream_list.atmosphere.diagnostics deleted file mode 100755 index b39754f..0000000 --- a/scripts/namelists/stream_list.atmosphere.diagnostics +++ /dev/null @@ -1,72 +0,0 @@ -initial_time -xtime -Time -t_iso_levels -zgeo_isobaric -cldfrac_isobaric -temperature_isobaric -dewpoint_isobaric -relhum_isobaric -w_isobaric -uzonal_isobaric -umeridional_isobaric -vorticity_isobaric -height_isobaric -spechum_isobaric -omega_isobaric -rqvblten_isobaric -rthblten_isobaric -rqvcuten_isobaric -rthcuten_isobaric -rthratenlw_isobaric -rthratensw_isobaric -rucuten_isobaric -rvcuten_isobaric -rvblten_isobaric -rublten_isobaric -kzq_isobaric -kzh_isobaric -kzm_isobaric -ni_isobaric -nr_isobaric -qr_isobaric -qs_isobaric -qv_isobaric -qc_isobaric -qg_isobaric -qi_isobaric -t2m -rainc -rainnc -uzonal_surface -umeridional_surface -u10 -v10 -surface_pressure -sst -q2 -mslp -lh -hpbl -hfx -delta -cldfrac_tot_UPP -chs -cd -acswuptc -acswupt -acswupbc -acswupb -acswdntc -acswdnt -acswdnbc -acswdnb -acsnow -aclwuptc -aclwupt -aclwupbc -aclwupb -aclwdntc -aclwdnt -aclwdnbc -aclwdnb diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT b/scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT deleted file mode 100755 index 3de9759..0000000 --- a/scripts/namelists/stream_list.atmosphere.diagnostics.CD-CT +++ /dev/null @@ -1,695 +0,0 @@ -t2m -rainc -rainnc -uzonal_surface -umeridional_surface -u10 -v10 -surface_pressure -relhum_15hPa -relhum_20hPa -relhum_30hPa -relhum_50hPa -relhum_70hPa -relhum_100hPa -relhum_150hPa -relhum_200hPa -relhum_250hPa -relhum_300hPa -relhum_400hPa -relhum_500hPa -relhum_600hPa -relhum_700hPa -relhum_825hPa -relhum_850hPa -relhum_875hPa -relhum_900hPa -relhum_925hPa -relhum_950hPa -relhum_975hPa -relhum_1000hPa -geoph_15hPa -geoph_20hPa -geoph_30hPa -geoph_50hPa -geoph_70hPa -geoph_100hPa -geoph_150hPa -geoph_200hPa -geoph_250hPa -geoph_300hPa -geoph_400hPa -geoph_500hPa -geoph_600hPa -geoph_700hPa -geoph_825hPa -geoph_850hPa -geoph_875hPa -geoph_900hPa -geoph_925hPa -geoph_950hPa -geoph_975hPa -geoph_1000hPa -sst -q2 -mslp -lh -hpbl -hfx -delta -cldfrac_tot_UPP -chs -cd -acswuptc -acswupt -acswupbc -acswupb -acswdntc -acswdnt -acswdnbc -acswdnb -acsnow -aclwuptc -aclwupt -aclwupbc -aclwupb -aclwdntc -aclwdnt -aclwdnbc -aclwdnb -w_15hPa -w_20hPa -w_30hPa -w_50hPa -w_70hPa -w_100hPa -w_150hPa -w_200hPa -w_250hPa -w_300hPa -w_400hPa -w_500hPa -w_600hPa -w_700hPa -w_825hPa -w_850hPa -w_875hPa -w_900hPa -w_925hPa -w_950hPa -w_975hPa -w_1000hPa -uzonal_15hPa -uzonal_20hPa -uzonal_30hPa -uzonal_50hPa -uzonal_70hPa -uzonal_100hPa -uzonal_150hPa -uzonal_200hPa -uzonal_250hPa -uzonal_300hPa -uzonal_400hPa -uzonal_500hPa -uzonal_600hPa -uzonal_700hPa -uzonal_825hPa -uzonal_850hPa -uzonal_875hPa -uzonal_900hPa -uzonal_925hPa -uzonal_950hPa -uzonal_975hPa -uzonal_1000hPa -umeridional_15hPa -umeridional_20hPa -umeridional_30hPa -umeridional_50hPa -umeridional_70hPa -umeridional_100hPa -umeridional_150hPa -umeridional_200hPa -umeridional_250hPa -umeridional_300hPa -umeridional_400hPa -umeridional_500hPa -umeridional_600hPa -umeridional_700hPa -umeridional_825hPa -umeridional_850hPa -umeridional_875hPa -umeridional_900hPa -umeridional_925hPa -umeridional_950hPa -umeridional_975hPa -umeridional_1000hPa -temperature_15hPa -temperature_20hPa -temperature_30hPa -temperature_50hPa -temperature_70hPa -temperature_100hPa -temperature_150hPa -temperature_200hPa -temperature_250hPa -temperature_300hPa -temperature_400hPa -temperature_500hPa -temperature_600hPa -temperature_700hPa -temperature_825hPa -temperature_850hPa -temperature_875hPa -temperature_900hPa -temperature_925hPa -temperature_950hPa -temperature_975hPa -temperature_1000hPa -spechum_15hPa -spechum_20hPa -spechum_30hPa -spechum_50hPa -spechum_70hPa -spechum_100hPa -spechum_150hPa -spechum_200hPa -spechum_250hPa -spechum_300hPa -spechum_400hPa -spechum_500hPa -spechum_600hPa -spechum_700hPa -spechum_825hPa -spechum_850hPa -spechum_875hPa -spechum_900hPa -spechum_925hPa -spechum_950hPa -spechum_975hPa -spechum_1000hPa -rthratenlw_15hPa -rthratenlw_20hPa -rthratenlw_30hPa -rthratenlw_50hPa -rthratenlw_70hPa -rthratenlw_100hPa -rthratenlw_150hPa -rthratenlw_200hPa -rthratenlw_250hPa -rthratenlw_300hPa -rthratenlw_400hPa -rthratenlw_500hPa -rthratenlw_600hPa -rthratenlw_700hPa -rthratenlw_825hPa -rthratenlw_850hPa -rthratenlw_875hPa -rthratenlw_900hPa -rthratenlw_925hPa -rthratenlw_950hPa -rthratenlw_975hPa -rthratenlw_1000hPa -rqvcuten_15hPa -rqvcuten_20hPa -rqvcuten_30hPa -rqvcuten_50hPa -rqvcuten_70hPa -rqvcuten_100hPa -rqvcuten_150hPa -rqvcuten_200hPa -rqvcuten_250hPa -rqvcuten_300hPa -rqvcuten_400hPa -rqvcuten_500hPa -rqvcuten_600hPa -rqvcuten_700hPa -rqvcuten_825hPa -rqvcuten_850hPa -rqvcuten_875hPa -rqvcuten_900hPa -rqvcuten_925hPa -rqvcuten_950hPa -rqvcuten_975hPa -rqvcuten_1000hPa -rqvblten_15hPa -rqvblten_20hPa -rqvblten_30hPa -rqvblten_50hPa -rqvblten_70hPa -rqvblten_100hPa -rqvblten_150hPa -rqvblten_200hPa -rqvblten_250hPa -rqvblten_300hPa -rqvblten_400hPa -rqvblten_500hPa -rqvblten_600hPa -rqvblten_700hPa -rqvblten_825hPa -rqvblten_850hPa -rqvblten_875hPa -rqvblten_900hPa -rqvblten_925hPa -rqvblten_950hPa -rqvblten_975hPa -rqvblten_1000hPa -kzh_15hPa -kzh_20hPa -kzh_30hPa -kzh_50hPa -kzh_70hPa -kzh_100hPa -kzh_150hPa -kzh_200hPa -kzh_250hPa -kzh_300hPa -kzh_400hPa -kzh_500hPa -kzh_600hPa -kzh_700hPa -kzh_825hPa -kzh_850hPa -kzh_875hPa -kzh_900hPa -kzh_925hPa -kzh_950hPa -kzh_975hPa -kzh_1000hPa -kzm_15hPa -kzm_20hPa -kzm_30hPa -kzm_50hPa -kzm_70hPa -kzm_100hPa -kzm_150hPa -kzm_200hPa -kzm_250hPa -kzm_300hPa -kzm_400hPa -kzm_500hPa -kzm_600hPa -kzm_700hPa -kzm_825hPa -kzm_850hPa -kzm_875hPa -kzm_900hPa -kzm_925hPa -kzm_950hPa -kzm_975hPa -kzm_1000hPa -kzq_15hPa -kzq_20hPa -kzq_30hPa -kzq_50hPa -kzq_70hPa -kzq_100hPa -kzq_150hPa -kzq_200hPa -kzq_250hPa -kzq_300hPa -kzq_400hPa -kzq_500hPa -kzq_600hPa -kzq_700hPa -kzq_825hPa -kzq_850hPa -kzq_875hPa -kzq_900hPa -kzq_925hPa -kzq_950hPa -kzq_975hPa -kzq_1000hPa -height_15hPa -height_20hPa -height_30hPa -height_50hPa -height_70hPa -height_100hPa -height_150hPa -height_200hPa -height_250hPa -height_300hPa -height_400hPa -height_500hPa -height_600hPa -height_700hPa -height_825hPa -height_850hPa -height_875hPa -height_900hPa -height_925hPa -height_950hPa -height_975hPa -height_1000hPa -qc_15hPa -qc_20hPa -qc_30hPa -qc_50hPa -qc_70hPa -qc_100hPa -qc_150hPa -qc_200hPa -qc_250hPa -qc_300hPa -qc_400hPa -qc_500hPa -qc_600hPa -qc_700hPa -qc_825hPa -qc_850hPa -qc_875hPa -qc_900hPa -qc_925hPa -qc_950hPa -qc_975hPa -qc_1000hPa -qg_15hPa -qg_20hPa -qg_30hPa -qg_50hPa -qg_70hPa -qg_100hPa -qg_150hPa -qg_200hPa -qg_250hPa -qg_300hPa -qg_400hPa -qg_500hPa -qg_600hPa -qg_700hPa -qg_825hPa -qg_850hPa -qg_875hPa -qg_900hPa -qg_925hPa -qg_950hPa -qg_975hPa -qg_1000hPa -qi_15hPa -qi_20hPa -qi_30hPa -qi_50hPa -qi_70hPa -qi_100hPa -qi_150hPa -qi_200hPa -qi_250hPa -qi_300hPa -qi_400hPa -qi_500hPa -qi_600hPa -qi_700hPa -qi_825hPa -qi_850hPa -qi_875hPa -qi_900hPa -qi_925hPa -qi_950hPa -qi_975hPa -qi_1000hPa -qv_15hPa -qv_20hPa -qv_30hPa -qv_50hPa -qv_70hPa -qv_100hPa -qv_150hPa -qv_200hPa -qv_250hPa -qv_300hPa -qv_400hPa -qv_500hPa -qv_600hPa -qv_700hPa -qv_825hPa -qv_850hPa -qv_875hPa -qv_900hPa -qv_925hPa -qv_950hPa -qv_975hPa -qv_1000hPa -qr_15hPa -qr_20hPa -qr_30hPa -qr_50hPa -qr_70hPa -qr_100hPa -qr_150hPa -qr_200hPa -qr_250hPa -qr_300hPa -qr_400hPa -qr_500hPa -qr_600hPa -qr_700hPa -qr_825hPa -qr_850hPa -qr_875hPa -qr_900hPa -qr_925hPa -qr_950hPa -qr_975hPa -qr_1000hPa -qs_15hPa -qs_20hPa -qs_30hPa -qs_50hPa -qs_70hPa -qs_100hPa -qs_150hPa -qs_200hPa -qs_250hPa -qs_300hPa -qs_400hPa -qs_500hPa -qs_600hPa -qs_700hPa -qs_825hPa -qs_850hPa -qs_875hPa -qs_900hPa -qs_925hPa -qs_950hPa -qs_975hPa -qs_1000hPa -ni_15hPa -ni_20hPa -ni_30hPa -ni_50hPa -ni_70hPa -ni_100hPa -ni_150hPa -ni_200hPa -ni_250hPa -ni_300hPa -ni_400hPa -ni_500hPa -ni_600hPa -ni_700hPa -ni_825hPa -ni_850hPa -ni_875hPa -ni_900hPa -ni_925hPa -ni_950hPa -ni_975hPa -ni_1000hPa -nr_15hPa -nr_20hPa -nr_30hPa -nr_50hPa -nr_70hPa -nr_100hPa -nr_150hPa -nr_200hPa -nr_250hPa -nr_300hPa -nr_400hPa -nr_500hPa -nr_600hPa -nr_700hPa -nr_825hPa -nr_850hPa -nr_875hPa -nr_900hPa -nr_925hPa -nr_950hPa -nr_975hPa -nr_1000hPa -rucuten_15hPa -rucuten_20hPa -rucuten_30hPa -rucuten_50hPa -rucuten_70hPa -rucuten_100hPa -rucuten_150hPa -rucuten_200hPa -rucuten_250hPa -rucuten_300hPa -rucuten_400hPa -rucuten_500hPa -rucuten_600hPa -rucuten_700hPa -rucuten_825hPa -rucuten_850hPa -rucuten_875hPa -rucuten_900hPa -rucuten_925hPa -rucuten_950hPa -rucuten_975hPa -rucuten_1000hPa -rvcuten_15hPa -rvcuten_20hPa -rvcuten_30hPa -rvcuten_50hPa -rvcuten_70hPa -rvcuten_100hPa -rvcuten_150hPa -rvcuten_200hPa -rvcuten_250hPa -rvcuten_300hPa -rvcuten_400hPa -rvcuten_500hPa -rvcuten_600hPa -rvcuten_700hPa -rvcuten_825hPa -rvcuten_850hPa -rvcuten_875hPa -rvcuten_900hPa -rvcuten_925hPa -rvcuten_950hPa -rvcuten_975hPa -rvcuten_1000hPa -rvblten_15hPa -rvblten_20hPa -rvblten_30hPa -rvblten_50hPa -rvblten_70hPa -rvblten_100hPa -rvblten_150hPa -rvblten_200hPa -rvblten_250hPa -rvblten_300hPa -rvblten_400hPa -rvblten_500hPa -rvblten_600hPa -rvblten_700hPa -rvblten_825hPa -rvblten_850hPa -rvblten_875hPa -rvblten_900hPa -rvblten_925hPa -rvblten_950hPa -rvblten_975hPa -rvblten_1000hPa -cldfrac_15hPa -cldfrac_20hPa -cldfrac_30hPa -cldfrac_50hPa -cldfrac_70hPa -cldfrac_100hPa -cldfrac_150hPa -cldfrac_200hPa -cldfrac_250hPa -cldfrac_300hPa -cldfrac_400hPa -cldfrac_500hPa -cldfrac_600hPa -cldfrac_700hPa -cldfrac_825hPa -cldfrac_850hPa -cldfrac_875hPa -cldfrac_900hPa -cldfrac_925hPa -cldfrac_950hPa -cldfrac_975hPa -cldfrac_1000hPa -rublten_15hPa -rublten_20hPa -rublten_30hPa -rublten_50hPa -rublten_70hPa -rublten_100hPa -rublten_150hPa -rublten_200hPa -rublten_250hPa -rublten_300hPa -rublten_400hPa -rublten_500hPa -rublten_600hPa -rublten_700hPa -rublten_825hPa -rublten_850hPa -rublten_875hPa -rublten_900hPa -rublten_925hPa -rublten_950hPa -rublten_975hPa -rublten_1000hPa -rthratensw_15hPa -rthratensw_20hPa -rthratensw_30hPa -rthratensw_50hPa -rthratensw_70hPa -rthratensw_100hPa -rthratensw_150hPa -rthratensw_200hPa -rthratensw_250hPa -rthratensw_300hPa -rthratensw_400hPa -rthratensw_500hPa -rthratensw_600hPa -rthratensw_700hPa -rthratensw_825hPa -rthratensw_850hPa -rthratensw_875hPa -rthratensw_900hPa -rthratensw_925hPa -rthratensw_950hPa -rthratensw_975hPa -rthratensw_1000hPa -omega_15hPa -omega_20hPa -omega_30hPa -omega_50hPa -omega_70hPa -omega_100hPa -omega_150hPa -omega_200hPa -omega_250hPa -omega_300hPa -omega_400hPa -omega_500hPa -omega_600hPa -omega_700hPa -omega_825hPa -omega_850hPa -omega_875hPa -omega_900hPa -omega_925hPa -omega_950hPa -omega_975hPa -omega_1000hPa -zgeo_15hPa -zgeo_20hPa -zgeo_30hPa -zgeo_50hPa -zgeo_70hPa -zgeo_100hPa -zgeo_150hPa -zgeo_200hPa -zgeo_250hPa -zgeo_300hPa -zgeo_400hPa -zgeo_500hPa -zgeo_600hPa -zgeo_700hPa -zgeo_825hPa -zgeo_850hPa -zgeo_875hPa -zgeo_900hPa -zgeo_925hPa -zgeo_950hPa -zgeo_975hPa -zgeo_1000hPa diff --git a/scripts/namelists/stream_list.atmosphere.diagnostics.GCC b/scripts/namelists/stream_list.atmosphere.diagnostics.GCC deleted file mode 100755 index b39754f..0000000 --- a/scripts/namelists/stream_list.atmosphere.diagnostics.GCC +++ /dev/null @@ -1,72 +0,0 @@ -initial_time -xtime -Time -t_iso_levels -zgeo_isobaric -cldfrac_isobaric -temperature_isobaric -dewpoint_isobaric -relhum_isobaric -w_isobaric -uzonal_isobaric -umeridional_isobaric -vorticity_isobaric -height_isobaric -spechum_isobaric -omega_isobaric -rqvblten_isobaric -rthblten_isobaric -rqvcuten_isobaric -rthcuten_isobaric -rthratenlw_isobaric -rthratensw_isobaric -rucuten_isobaric -rvcuten_isobaric -rvblten_isobaric -rublten_isobaric -kzq_isobaric -kzh_isobaric -kzm_isobaric -ni_isobaric -nr_isobaric -qr_isobaric -qs_isobaric -qv_isobaric -qc_isobaric -qg_isobaric -qi_isobaric -t2m -rainc -rainnc -uzonal_surface -umeridional_surface -u10 -v10 -surface_pressure -sst -q2 -mslp -lh -hpbl -hfx -delta -cldfrac_tot_UPP -chs -cd -acswuptc -acswupt -acswupbc -acswupb -acswdntc -acswdnt -acswdnbc -acswdnb -acsnow -aclwuptc -aclwupt -aclwupbc -aclwupb -aclwdntc -aclwdnt -aclwdnbc -aclwdnb diff --git a/scripts/namelists/streams.atmosphere.TEMPLATE b/scripts/namelists/streams.atmosphere.TEMPLATE index d6c28bc..9e9ff6a 100755 --- a/scripts/namelists/streams.atmosphere.TEMPLATE +++ b/scripts/namelists/streams.atmosphere.TEMPLATE @@ -14,7 +14,7 @@ @@ -23,7 +23,7 @@ diff --git a/scripts/stools/setenv_PBS_ian_cray.bash b/scripts/stools/setenv_PBS_ian_cray.bash index 0280b15..97bf3b3 100755 --- a/scripts/stools/setenv_PBS_ian_cray.bash +++ b/scripts/stools/setenv_PBS_ian_cray.bash @@ -27,7 +27,6 @@ export STATIC_nthreads=1 export STATIC_jobname="Pre.static" export STATIC_walltime="02:00:00" - # PRE-Degrib phase: export DEGRIB_QUEUE="pesqextra" export DEGRIB_ncores=1 @@ -48,6 +47,16 @@ export INITATMOS_nthreads=1 export INITATMOS_jobname="Pre.InitAtmos" export INITATMOS_walltime="02:00:00" +# PRE-LBCs phase: +export LBCS_QUEUE="pesqextra" +export LBCS_ncores=64 +export LBCS_nnodes=1 +export LBCS_ncpus=64 +export LBCS_ncpn=64 +export LBCS_nthreads=1 +export LBCS_jobname="Pre.LBCS" +export LBCS_walltime="02:00:00" + # Model phase: export MODEL_QUEUE="pesqextra" export MODEL_ncores=2048 diff --git a/scripts/stools/setenv_PBS_ian_gnu.bash b/scripts/stools/setenv_PBS_ian_gnu.bash index a2cf615..2e64a54 100755 --- a/scripts/stools/setenv_PBS_ian_gnu.bash +++ b/scripts/stools/setenv_PBS_ian_gnu.bash @@ -27,7 +27,6 @@ export STATIC_nthreads=1 export STATIC_jobname="Pre.static" export STATIC_walltime="02:00:00" - # PRE-Degrib phase: export DEGRIB_QUEUE="pesqextra" export DEGRIB_ncores=1 @@ -48,6 +47,16 @@ export INITATMOS_nthreads=1 export INITATMOS_jobname="Pre.InitAtmos" export INITATMOS_walltime="02:00:00" +# PRE-LBCs phase: +export LBCS_QUEUE="pesqextra" +export LBCS_ncores=64 +export LBCS_nnodes=1 +export LBCS_ncpus=64 +export LBCS_ncpn=64 +export LBCS_nthreads=1 +export LBCS_jobname="Pre.LBCS" +export LBCS_walltime="02:00:00" + # Model phase: export MODEL_QUEUE="pesqextra" export MODEL_ncores=2048 @@ -86,7 +95,6 @@ export GCCCIS=/p/projetos/monan_adm/monan/CIs export PIO= export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib64:$LD_LIBRARY_PATH - # --- Others Variables --- # HPE Slingshot/Libfabric: export FI_CXI_REQ_BUF_SIZE=25165824 diff --git a/scripts/stools/setenv_PBS_ian_intel.bash b/scripts/stools/setenv_PBS_ian_intel.bash index 5f0ae81..02cdc33 100755 --- a/scripts/stools/setenv_PBS_ian_intel.bash +++ b/scripts/stools/setenv_PBS_ian_intel.bash @@ -59,8 +59,8 @@ export LBCS_walltime="02:00:00" # Model phase: export MODEL_QUEUE="pesqextra" -export MODEL_ncores=4096 -export MODEL_nnodes=16 +export MODEL_ncores=2048 +export MODEL_nnodes=8 export MODEL_ncpus=256 export MODEL_ncpn=256 export MODEL_nthreads=1 @@ -95,7 +95,6 @@ export GCCCIS=/p/projetos/monan_adm/monan/CIs export PIO= export LD_LIBRARY_PATH=$NETCDF/lib:$PNETCDF/lib:$PIO/lib64:$LD_LIBRARY_PATH - # --- Others Variables --- # HPE Slingshot/Libfabric: export FI_CXI_REQ_BUF_SIZE=25165824 From 3ceb8b85db899dbc87bb1cc4fb41e945659d51b7 Mon Sep 17 00:00:00 2001 From: Joao Messias Date: Wed, 1 Jul 2026 01:54:29 +0000 Subject: [PATCH 71/72] restore make_degrib.bash to make_degrib_GFS.bash --- scripts/make_degrib_GFS.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make_degrib_GFS.bash b/scripts/make_degrib_GFS.bash index abe6f9c..0d48f0d 100755 --- a/scripts/make_degrib_GFS.bash +++ b/scripts/make_degrib_GFS.bash @@ -86,7 +86,7 @@ then else BNDDIR=${DATAIN}/${EXP}/${YYYYMMDDHHi} fi - else + else BNDDIR=${GCCCIS}/${EXP}/${YYYYMMDDHHi:0:4}/${YYYYMMDDHHi} fi fi @@ -309,7 +309,7 @@ do fi done -mv ${DIRRUN}/degrib_GFS.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs +mv ${DIRRUN}/degrib_${EXP}.bash ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs chmod 755 ${DATAOUT}/${YYYYMMDDHHi}/Pre/* JOBID=$(sed -n '4p' ${DATAOUT}/${YYYYMMDDHHi}/Pre/logs/degrib_${EXP}.o | awk '{print $3}' | sed "s/.pbs-ha//g") From 9e500927751c39330592e54ad8651ef1af6dee83 Mon Sep 17 00:00:00 2001 From: Joao Messias Date: Thu, 2 Jul 2026 01:11:32 +0000 Subject: [PATCH 72/72] Rename ERA5 to ERA due to a convert_mpas restriction in filename - Time_Label --- scripts/0.run_all.bash | 2 +- scripts/2.pre_processing.bash | 8 ++++---- scripts/3.run_model.bash | 4 ++-- scripts/4.run_post.bash | 2 +- scripts/make_degrib_ERA5.bash | 4 ++-- scripts/make_degrib_GFS.bash | 2 +- scripts/make_lbcs.bash | 2 +- scripts/make_template.bash | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/scripts/0.run_all.bash b/scripts/0.run_all.bash index b7159ad..f33cf3c 100755 --- a/scripts/0.run_all.bash +++ b/scripts/0.run_all.bash @@ -44,7 +44,7 @@ convertmpas_branch=1.2.0 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=2026012000 #Check dates disponible for the initial condition (CI) using ERA5 +YYYYMMDDHHi=2026070100 #Check dates disponible for the initial condition (CI) using ERA5 FCST=24 #---------------------------------------------------------------------- diff --git a/scripts/2.pre_processing.bash b/scripts/2.pre_processing.bash index 2420911..ad04764 100755 --- a/scripts/2.pre_processing.bash +++ b/scripts/2.pre_processing.bash @@ -25,7 +25,7 @@ then echo "" echo "${0} EXP_NAME/OP RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS or ERA5" + 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)" @@ -94,7 +94,7 @@ then fi # Creating the x1.${RES}.static.nc file once, if does not exist yet:--------------- -if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" || ${EXP} == "ERA" ]]; then +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" @@ -116,7 +116,7 @@ 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} == "ERA5" || ${EXP} == "ERA" ]] +elif [[ ${EXP} == "ERA" ]] then echo -e "${GREEN}==>${NC} Submitting Degrib for ERA5 data...\n" time ./make_degrib_ERA5.bash ${EXP} ${RES} ${YYYYMMDDHHi} ${FCST} @@ -129,7 +129,7 @@ fi #---------------------------------------------------------------------------------- # Init Atmosphere phase:------------------------------------------------------------ -if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" || ${EXP} == "ERA" ]]; then +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 diff --git a/scripts/3.run_model.bash b/scripts/3.run_model.bash index 0b3961d..a527d03 100755 --- a/scripts/3.run_model.bash +++ b/scripts/3.run_model.bash @@ -23,7 +23,7 @@ then echo "" echo "${0} [EXP_NAME/OP] RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS or ERA5" + echo "EXP_NAME :: Forcing: GFS or ERA" echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." @@ -192,7 +192,7 @@ cp -f ${DATAIN}/fixed/Vtable.${EXP} ${DIRRUN} if [[ $MODERUN == "R" ]]; then cp -f ${DATAOUT}/${YYYYMMDDHHi}/Pre/lbc*.nc ${DIRRUN} fi -if [[ ${EXP} == "GFS" || ${EXP} == "ERA5" || ${EXP} == "ERA" ]] +if [[ ${EXP} == "GFS" || ${EXP} == "ERA" ]] then sed -e "s,#LABELI#,${start_date},g;s,#FCSTS#,${DD_HHMMSS_forecast},g;s,#RES#,${RES},g; s,#CONFIG_DT#,${CONFIG_DT},g;s,#CONFIG_LEN_DISP#,${CONFIG_LEN_DISP},g;s,#CONFIG_CONV_INTERVAL#,${CONFIG_CONV_INTERVAL},g;s,#APPLY_LBCS#,${APPLY_LBCS},g" \ diff --git a/scripts/4.run_post.bash b/scripts/4.run_post.bash index 72abdc9..4bca3aa 100755 --- a/scripts/4.run_post.bash +++ b/scripts/4.run_post.bash @@ -23,7 +23,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 "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" echo "FCST :: Forecast hours, e.g.: 24 or 36, etc." diff --git a/scripts/make_degrib_ERA5.bash b/scripts/make_degrib_ERA5.bash index 25a92f4..279fd34 100755 --- a/scripts/make_degrib_ERA5.bash +++ b/scripts/make_degrib_ERA5.bash @@ -8,7 +8,7 @@ then echo "" echo "${0} EXP_NAME RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS or ERA5" + 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 "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" @@ -43,7 +43,7 @@ EXECS=${DIRHOMED}/execs; mkdir -p ${EXECS} # Input variables:-------------------------------------- -EXP=${1}; #EXP=ERA5 +EXP=${1}; #EXP=ERA RES=${2}; #RES=1024002 YYYYMMDDHHi=${3}; #YYYYMMDDHHi=2024012000 FCST=${4}; #FCST=24 diff --git a/scripts/make_degrib_GFS.bash b/scripts/make_degrib_GFS.bash index 0d48f0d..479d69e 100755 --- a/scripts/make_degrib_GFS.bash +++ b/scripts/make_degrib_GFS.bash @@ -9,7 +9,7 @@ then echo "" echo "${0} EXP_NAME RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS or ERA5" + 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 "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" diff --git a/scripts/make_lbcs.bash b/scripts/make_lbcs.bash index 939da66..b6e3648 100755 --- a/scripts/make_lbcs.bash +++ b/scripts/make_lbcs.bash @@ -8,7 +8,7 @@ then echo "" echo "${0} EXP_NAME RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS or ERA5" + 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 "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" diff --git a/scripts/make_template.bash b/scripts/make_template.bash index c95c821..eff9107 100755 --- a/scripts/make_template.bash +++ b/scripts/make_template.bash @@ -23,7 +23,7 @@ then echo "" echo "${0} ]EXP_NAME/OP] RESOLUTION LABELI FCST" echo "" - echo "EXP_NAME :: Forcing: GFS or ERA5" + echo "EXP_NAME :: Forcing: GFS or ERA" echo "RESOLUTION :: number of points in resolution model grid, e.g: 1024002 (24 km)" echo "LABELI :: Initial date YYYYMMDDHH, e.g.: 2024010100" echo "FCST :: Forecast hours, e.g.: 24 or 36, etc."