Skip to content

Commit

Permalink
Merge pull request #270 from chrislxj/CoLM202X-CROP
Browse files Browse the repository at this point in the history
Fix several bugs in vcmax and run scripts
  • Loading branch information
CoLM-SYSU authored May 27, 2024
2 parents 934364c + da0bc3a commit 86f9e2f
Show file tree
Hide file tree
Showing 7 changed files with 203 additions and 65 deletions.
2 changes: 1 addition & 1 deletion main/MOD_Const_PFT.F90
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ MODULE MOD_Const_PFT
, 57.0, 57.0, 57.0, 57.0, 57.0, 57.0, 57.0, 57.0&
, 57.0, 57.0, 57.0, 57.0, 57.0, 57.0, 57.0 &
#endif
/) * 0.3 * 1.e-6
/) * 1.e-6

! quantum efficiency
real(r8), parameter :: effcon_p(0:N_PFT+N_CFT-1) &
Expand Down
113 changes: 113 additions & 0 deletions run/copy_code
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/bin/bash

Help()
{
#DISPLAY help
echo "-------------------- Usage ----------------------------------------------------"
echo "Descripion:clone CoLM simulation case from an existing case"

echo "-------------------------------------------------------------------------------"
echo 'Syntax: ./copy_code -s $SourcePath -d $DestinationPath'
echo !--------------------------------------------------------------------------------
echo
echo 'eg. ./copy_code -s ~/CoLM/cases/TEST1/bld -d /home/luxj/CoLM202X/cases/TEST2/bld'
echo ' which will copy the code under case ~/CoLM/cases/TEST1 to the code under the case '
echo "/home/luxj/CoLM202X/cases/TEST2"
echo
echo 'or ./copy_code -s ~/CoLM/ -d /home/luxj/CoLM202X/cases/TEST2/bld'
echo ' which will copy the code under ~/CoLM to the code under the case '
echo "/home/luxj/CoLM202X/cases/TEST2"
echo
echo options:
echo "-s (optional) "'$SourcePath'" is the path of the source code, which location your"
echo " want to copy from (including case name and 'bld' folder, but without ''/'' at"
echo " end of case path)"
echo " if -s optioin is not present, copy source code from the ROOT"
echo
echo "-d The path of the destimation code, which location you want to copy to "
echo "(including case name and "'bld'" folder but without ''/'' at end of case path)"
echo
echo -h display command information
}

CopyCode()
{

SourcePathName=$1
DestPathName=$2
mkdir -p $DestPathName
cd $SourcePathName

for files1 in *
do
if [ -f $files1 ];then
cp -p $files1 $DestPathName/
else
if [ -d $files1 ];then
mkdir -p $DestPathName/$files1
cd $SourcePathName/$files1
echo copy $files1
if [ $files1 = CaMa -o $files1 = include -o $files1 = run -o $files1 = preprocess ];then
cp -pr * $DestPathName/$files1/
else
if [ $files1 = cases ];then
echo ignore cases directory
else
if [ $files1 = postprocess ];then
cp -p *F90 $DestPathName/$files1/
else
for files2 in *
do
if [ -d $files2 ];then
mkdir -p $DestPathName/$files1/$files2/
cd $SourcePathName/$files1/$files2
echo copy $files1/$files2
for files3 in *
do
if echo $files3 | grep -q -E '.F90$'
then
cp -p $files3 $DestPathName/$files1/$files2/
fi
done
cd ../
else
if echo $files2 | grep -q -E '.F90$'
then
cp -p $files2 $DestPathName/$files1/
fi
fi
done
fi
fi
fi
cd ..
fi
fi
done
}


while getopts ":hs:d:" options ;
do
case $options in
s) Source="$OPTARG" ;;
d) Destination="$OPTARG" ;;
h) Help; exit;;
*) echo "invalid option: $@";exit ;;
esac
done

if [ -z "${Source}" ] || [ -z "${Destination}" ]; then
echo
echo 'Error: either "-s" or "-d" is missing'
echo
Help
exit
else
if [ ! -d "${Source}" ];then
echo Source folder does not exist or is not a folder
fi
echo "copy source code: $Source"
echo "to destimation: $Destination"
CopyCode $Source $Destination
fi
2 changes: 1 addition & 1 deletion run/create_header
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ CreateHeader()
fi
}

CreateHeader Global_Grid_50km_PFT_VG mksrf.submit /data/sysu_daiyj_01/luxj/CoLM202X/run/jobs.config-earthlab /data/sysu_daiyj_01/luxj/CoLM202X/run/mpi.config
CreateHeader Global_Grid_50km_PFT_VG mksrf.submit $ROOT/run/jobs.config-earthlab $ROOT/run/mpi.config
33 changes: 21 additions & 12 deletions run/create_newcase
Original file line number Diff line number Diff line change
Expand Up @@ -247,21 +247,23 @@ NdaysofYear()
#FORCINGNML=$ROOT/run/forcing/GSWP3.nml

#machine = baiduboat
#ROOT=/share/home/dq010/CoLM/CoLM202X-CROP
#RAWDATA=/share/home/dq010/CoLM/data/rawdata/CROP-NITRIF/CLMrawdata_updating/
#RUNTIME=/share/home/dq010/CoLM/data/rawdata/CROP-NITRIF/CoLMruntime//
#MAKEOPTION=$ROOT/include/Makeoptions-baiduboat-intel
#FORCINGPATH=/share/home/dq010/CoLM/data/inputdata/atm/GSWP3/

#machine = earthlab
ROOT=/data/sysu_daiyj_01/luxj/CoLM202X/
RAWDATA=/data/sysu_daiyj_01/data_mpi/CLMrawdata_igbp/
RUNTIME=/data/sysu_daiyj_01/data_mpi/CoLMruntime/
MAKEOPTION=$ROOT/include/Makeoptions-earthlab-par
FORCINGPATH=/data/zhangh/data/lifang/GSWP-future/SSP126/
ROOT=/share/home/dq010/CoLM/CoLM202X-CROP
RAWDATA=/share/home/dq010/CoLM/data/rawdata/CROP-NITRIF/CLMrawdata_updating/
RUNTIME=/share/home/dq010/CoLM/data/rawdata/CROP-NITRIF/CoLMruntime//
MAKEOPTION=$ROOT/include/Makeoptions-baiduboat-intel
FORCINGPATH=/share/home/dq010/CoLM/data/inputdata/atm/GSWP3/
HEADER=$ROOT/run/jobs.config
CONFIG=$ROOT/run/mpi.config

#machine = earthlab
#ROOT=/data/sysu_daiyj_01/luxj/CoLM202X/
#RAWDATA=/data/sysu_daiyj_01/data_mpi/CLMrawdata_igbp/
#RUNTIME=/data/sysu_daiyj_01/data_mpi/CoLMruntime/
#MAKEOPTION=$ROOT/include/Makeoptions-earthlab-par
#FORCINGPATH=/data/zhangh/data/lifang/GSWP-future/SSP126/
#HEADER=$ROOT/run/jobs.config
#CONFIG=$ROOT/run/mpi.config

while getopts ":hbprlun:i:t:e:c:g:s:m:" options ;
do
case $options in
Expand Down Expand Up @@ -573,9 +575,11 @@ else
fi
if [ -z "$LuLCC" ];then
IsDefLuLCC="#undef"
LandMask=False
else
if [ $LuLCC == True ];then
IsDefLuLCC="#define"
LandMask="DEF_file_mesh='$RAWDATA/landdata/landmask_igbp_10km_Guangdong-extended.nc'"
else
echo Error in LuLCC definition
exit
Expand Down Expand Up @@ -717,6 +721,11 @@ else
exit
;;
esac
else
IsDefUSGS="#undef"
IsDefIGBP="#undef"
IsDefPFT="#define"
IsDefPC="#undef"
fi

if [ ! -z "$SoilModel" ];then
Expand Down
4 changes: 3 additions & 1 deletion run/create_scripts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ CreateScripts()
RESTENDYR=`expr $ENDYR + 1`
ILOOP='$iloop'
LOOPPLUS='iloop=`expr $iloop + 1`'
SEQYR='`seq -w `'${STARTYR}' '${ENDYR}'`'
SEQYR='`seq -w '${STARTYR}' '${ENDYR}'`'
SEQMO='`seq -w 1 12 `'
YEARMON='${iyr}-${i}'
NDAYSOFENDYR=`NdaysofYear ${endyr}`
Expand Down Expand Up @@ -393,6 +393,8 @@ if [ -z "${ENDYR}" ];then
echo "Note: -e option is absent, set endyr 2000 as the default."
echo
ENDYR=2000
else
ENDYR=`expr $ENDYR - 1`
fi

echo HEADER before check $HEADER
Expand Down
86 changes: 50 additions & 36 deletions run/jobs.config
Original file line number Diff line number Diff line change
@@ -1,40 +1,54 @@
#!/bin/bash

#SBATCH -J <CASENAME>
#SBATCH -p <QUEUE>
#SBATCH -N <NNODES>
#SBATCH -n <NPROCESSES>
#SBATCH --ntasks-per-node=<NTASKSPERNODE>
#SBATCH --mem=<MEMORY>
#SBATCH -o colm.o%j
#SBATCH -e colm.e%j
#SBATCH --exclusive
#SBATCH -t <WALLTIME>
#------------------------------earthlab--------------------------------------------
##!/bin/bash
#
##SBATCH -J <CASENAME>
##SBATCH -p <QUEUE>
##SBATCH -N <NNODES>
##SBATCH -n <NPROCESSES>
##SBATCH --ntasks-per-node=<NTASKSPERNODE>
##SBATCH --mem=<MEMORY>
##SBATCH -o colm.o%j
##SBATCH -e colm.e%j
##SBATCH --exclusive
##SBATCH -t <WALLTIME>
#
#module purge
#module load compiler/intel/2021.3.1
#module load mpi/intelmpi/2018.4.274
#module load mathlib/netcdf/intel/4.4.1
#module load mathlib/hdf5/intel/1.8.20
#
#export I_MPI_FABRICS=shm:dapl
#export I_MPI_DAPL_UD=1
#export I_MPI_DAPL_UD_RDMA_MIXED=1
#export I_MPI_LARGE_SCALE_THRESHOLD=8192
#export I_MPI_DAPL_UD_ACK_SEND_POOL_SIZE=8704
#export I_MPI_DAPL_UD_ACK_RECV_POOL_SIZE=8704
#export I_MPI_DAPL_UD_RNDV_EP_NUM=2
#
#export DAPL_UCM_REP_TIME=8000 # REQUEST timer, waiting for REPLY in millisecs
#export DAPL_UCM_RTU_TIME=8000 # REPLY timer, waiting for RTU in millisecs
#export DAPL_UCM_RETRY=10 # REQUEST and REPLY retries
#export DAPL_UCM_CQ_SIZE=2000
#export DAPL_UCM_QP_SIZE=2000
#
#export DAPL_UCM_DREQ_RETRY=4 #default == 1
#export DAPL_UCM_DREP_TIME=200 #default == 200ms
#export DAPL_UCM_WAIT_TIME=10000 #default == 60000ms
#
#ulimit -s unlimited
#scontrol show hostname > nd
#NP=$SLURM_NPROCS

module purge
module load compiler/intel/2021.3.1
module load mpi/intelmpi/2018.4.274
module load mathlib/netcdf/intel/4.4.1
module load mathlib/hdf5/intel/1.8.20

export I_MPI_FABRICS=shm:dapl
export I_MPI_DAPL_UD=1
export I_MPI_DAPL_UD_RDMA_MIXED=1
export I_MPI_LARGE_SCALE_THRESHOLD=8192
export I_MPI_DAPL_UD_ACK_SEND_POOL_SIZE=8704
export I_MPI_DAPL_UD_ACK_RECV_POOL_SIZE=8704
export I_MPI_DAPL_UD_RNDV_EP_NUM=2

export DAPL_UCM_REP_TIME=8000 # REQUEST timer, waiting for REPLY in millisecs
export DAPL_UCM_RTU_TIME=8000 # REPLY timer, waiting for RTU in millisecs
export DAPL_UCM_RETRY=10 # REQUEST and REPLY retries
export DAPL_UCM_CQ_SIZE=2000
export DAPL_UCM_QP_SIZE=2000
#-------------------------------baiduboat------------------------------------------
#!/bin/bash

export DAPL_UCM_DREQ_RETRY=4 #default == 1
export DAPL_UCM_DREP_TIME=200 #default == 200ms
export DAPL_UCM_WAIT_TIME=10000 #default == 60000ms
#BSUB -J <CASENAME>
#BSUB -q <QUEUE>
#BSUB -o colm.o%
#BSUB -e colm.e%
#BSUB -n <NPROCESSES>
#BSUB -R rusage[mem=<MEMORY>]
#BSUB -R span[ptile=<NTASKSPERNODE>]

ulimit -s unlimited
scontrol show hostname > nd
NP=$SLURM_NPROCS
28 changes: 14 additions & 14 deletions run/mpi.config
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
NProcesses_mksrf 1000
NNodes_mksrf 20
NTasksPerNode_mksrf 50
Memory_mksrf 512G
Walltime_mksrf 7-24:00
Queue_mksrf bigmem
NProcesses_mkini 50
NProcesses_mksrf 672
NNodes_mksrf 14
NTasksPerNode_mksrf 48
Memory_mksrf 150G
Walltime_mksrf 24:00:00
Queue_mksrf normal
NProcesses_mkini 48
NNodes_mkini 1
NTasksPerNode_mkini 50
Memory_mkini 512G
Walltime_mkini 7-24:00
NTasksPerNode_mkini 48
Memory_mkini 150G
Walltime_mkini 24:00:00
Queue_mkini normal
NProcesses_case 250
NProcesses_case 240
NNodes_case 5
NTasksPerNode_case 50
Memory_case 512G
Walltime_case 7-24:00
NTasksPerNode_case 48
Memory_case 150G
Walltime_case 24:00:00
Queue_case normal

0 comments on commit 86f9e2f

Please sign in to comment.