diff --git a/src/arome/ial_version.json b/src/arome/ial_version.json new file mode 100644 index 0000000000000000000000000000000000000000..655712265303cf1fabcc6df67952ab8d4a5ac8c3 --- /dev/null +++ b/src/arome/ial_version.json @@ -0,0 +1,5 @@ +{ +"cycle":"48t3", +"branch":"main", +"version":"01" +} diff --git a/tools/INSTALL_pack_ial.md b/tools/INSTALL_pack_ial.md index c29f2ee3b22c878a92f61d3521c50a6b87ffd491..87f4c256473b3d59a455f0e0de09683ecf534296 100644 --- a/tools/INSTALL_pack_ial.md +++ b/tools/INSTALL_pack_ial.md @@ -226,7 +226,7 @@ commit=9ce8119430dd603d35308d8ae94cf18636157473 #exemple of commit to test again gmkpack -r ${cycle} -b phyex -v ${version} -l ${compiler} -o ${option} -p masterodb -f $TRUNK -u PHYEX/$commit cd $HOMEPACK/PHYEX/$commit/src/local/phyex -git clone git@github.com:QuentinRodier/PHYEX.git +git clone git@github.com:UMR-CNRM/PHYEX.git cd PHYEX git checkout $commit #The exact manipulation to perform depends on the commit to test. For a full description, please see the check\_commit\_ial.sh script diff --git a/tools/check_commit_ial.sh b/tools/check_commit_ial.sh index c089607206225106a61dc694b8d49d7b74c80a0c..44dc8955b3e5d232ad9fd8da23359d73d9d062e8 100755 --- a/tools/check_commit_ial.sh +++ b/tools/check_commit_ial.sh @@ -70,6 +70,10 @@ function usage { echo "--noexpand do not use mnh_expand (code will be in array-syntax)" echo "-f full compilation (do not use pre-compiled pack)" echo "--cycle CYCLE to force using CYCLE" + echo "--repo-user user hosting the PHYEX repository on github," + echo " defaults to the env variable PHYEXREOuser (=$PHYEXREOuser)" + echo "--repo-protocol protocol (https or ssh) to reach the PHYEX repository on github," + echo " defaults to the env variable PHYEXREOprotocol (=$PHYEXREOprotocol)" echo "" echo "If nothing is asked (compilation, running, check) everything is done" echo @@ -106,6 +110,8 @@ while [ -n "$1" ]; do '--noexpand') useexpand=0;; '-f') fullcompilation=1;; '--cycle') cycle="$2"; shift;; + '--repo-user') export PHYEXREPOuser=$2; shift;; + '--repo-protocol') export PHYEXREPOprotocol=$2; shift;; #--) shift; break ;; *) if [ -z "${commit-}" ]; then commit=$1 @@ -159,7 +165,7 @@ if [ $check -eq 1 -a -z "${reference-}" ]; then exit 3 fi -function content2cycle { +function apl_arome_content2cycle { # variable content_apl_arome must contain the source code of apl_arome.F90 if grep CPG_DYN_TYPE <(echo $content_apl_arome) > /dev/null; then echo 48t3 @@ -168,13 +174,23 @@ function content2cycle { fi } +function ial_version_content2cycle { + # variable content_ial_version must contain the source code of ial_version.json + content_ial_version=$content_ial_version python3 -c "import json; import os; print(json.loads(os.environ['content_ial_version'])['cycle'])" +} + #Name is choosen such as it can be produced with a main pack: PHYEX/${cycle}_XXXXXXXXX.01.${gmkpack_l}.${gmkpack_o} fromdir='' if echo $commit | grep '/' > /dev/null; then fromdir=$commit if [ "$cycle" == "" ]; then - content_apl_arome=$(scp $commit/src/arome/ext/apl_arome.F90 /dev/stdout) - cycle=$(content2cycle) + content_ial_version=$(scp $commit/src/arome/ial_version.json /dev/stdout 2>/dev/null || echo "") + if [ "$content_ial_version" == "" ]; then + content_apl_arome=$(scp $commit/src/arome/ext/apl_arome.F90 /dev/stdout) + cycle=$(apl_arome_content2cycle) + else + cycle=$(ial_version_content2cycle) + fi fi packBranch=$(echo $commit | sed 's/\//'${separator}'/g' | sed 's/:/'${separator}'/g' | sed 's/\./'${separator}'/g') name="PHYEX/${cycle}_${packBranch}.01.${gmkpack_l}.${gmkpack_o}" @@ -189,8 +205,13 @@ elif echo $specialPack | grep -w $commit > /dev/null; then else packBranch="COMMIT$commit" if [ "$cycle" == "" ]; then - content_apl_arome=$(wget --no-check-certificate https://raw.githubusercontent.com/QuentinRodier/PHYEX/${commit}/src/arome/ext/apl_arome.F90 -O - 2>/dev/null) - cycle=$(content2cycle) + content_ial_version=$(wget --no-check-certificate https://raw.githubusercontent.com/$PHYEXREPOuser/PHYEX/${commit}/src/arome/ial_version.json -O - 2>/dev/null || echo "") + if [ "$content_ial_version" == "" ]; then + content_apl_arome=$(wget --no-check-certificate https://raw.githubusercontent.com/$PHYEXREPOuser/PHYEX/${commit}/src/arome/ext/apl_arome.F90 -O - 2>/dev/null) + cycle=$(apl_arome_content2cycle) + else + cycle=$(ial_version_content2cycle) + fi fi name="PHYEX/${cycle}_${packBranch}.01.${gmkpack_l}.${gmkpack_o}" [ $suppress -eq 1 -a -d $HOMEPACK/$name ] && rm -rf $HOMEPACK/$name diff --git a/tools/check_commit_mesonh.sh b/tools/check_commit_mesonh.sh index 73ee6a0715d41731af12e993a0d4d0eabb0ccddd..0e1fd6896408c783674d623a52f222e2756b6fea 100755 --- a/tools/check_commit_mesonh.sh +++ b/tools/check_commit_mesonh.sh @@ -26,6 +26,10 @@ function usage { echo "-t comma separated list of tests to execute" echo " or ALL to execute all tests" echo "--expand use mnh_expand (code will use do loops)" + echo "--repo-user user hosting the PHYEX repository on github," + echo " defaults to the env variable PHYEXREOuser (=$PHYEXREOuser)" + echo "--repo-protocol protocol (https or ssh) to reach the PHYEX repository on github," + echo " defaults to the env variable PHYEXREOprotocol (=$PHYEXREOprotocol)" echo "" echo "If nothing is asked (compilation, running, check) everything is done" echo @@ -54,7 +58,8 @@ while [ -n "$1" ]; do '-C') check=1;; '-t') tests="$2"; shift;; '--expand') useexpand=1;; - #-b) param="$2"; shift ;; + '--repo-user') export PHYEXREPOuser=$2; shift;; + '--repo-protocol') export PHYEXREPOprotocol=$2; shift;; #--) shift; break ;; *) if [ -z "${commit-}" ]; then commit=$1 diff --git a/tools/check_commit_testprogs.sh b/tools/check_commit_testprogs.sh index e626568646e92567d474b6c3c38ce06c8527b47f..782d0cb9fb9bdd986efce8540d1fbd21f8119b87 100755 --- a/tools/check_commit_testprogs.sh +++ b/tools/check_commit_testprogs.sh @@ -39,6 +39,10 @@ function usage { echo "-t comma separated list of tests to execute" echo " or ALL to execute all tests" echo "--noexpand do not use mnh_expand (code will be in array-syntax)" + echo "--repo-user user hosting the PHYEX repository on github," + echo " defaults to the env variable PHYEXREOuser (=$PHYEXREOuser)" + echo "--repo-protocol protocol (https or ssh) to reach the PHYEX repository on github," + echo " defaults to the env variable PHYEXREOprotocol (=$PHYEXREOprotocol)" echo "" echo "If nothing is asked (compilation, running, check) everything is done" echo @@ -69,6 +73,8 @@ while [ -n "$1" ]; do '-C') check=1;; '-t') tests="$2"; shift;; '--noexpand') useexpand=0;; + '--repo-user') export PHYEXREPOuser=$2; shift;; + '--repo-protocol') export PHYEXREPOprotocol=$2; shift;; #--) shift; break ;; *) if [ -z "${commit-}" ]; then commit=$1 diff --git a/tools/prep_code.sh b/tools/prep_code.sh index 9d069e009aae06ade6afd0e2bc00bc9ba29d6110..3e318344fb71dd1d2df739a09ce1f8b25332a988 100755 --- a/tools/prep_code.sh +++ b/tools/prep_code.sh @@ -11,9 +11,6 @@ set -e ###### CONFIGURATION -repository_https=https://github.com/QuentinRodier/PHYEX.git -repository_ssh=git@github.com:QuentinRodier/PHYEX.git - PHYEXTOOLSDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ###### COMMAND LINE ARGUMENTS @@ -29,7 +26,8 @@ function usage { echo "-p push the result as a new branch" echo "-s SUB subdiretory or file (under src) to consider when merging and applying mnh_expand" echo "--renameFf rename .F90 into .f90" - echo "--ssh use ssh instead of https for git cloning" + echo "--repo use this repository instead of the one derived (if any) from the env variables" + echo " PHYEXREPOuser (=$PHYEXREPOuser) and PHYEXREPOprotocol (=$PHYEXREPOprotocol)" echo "-v add verbosity (up to 3 -v)" echo "" echo "* If the -c option is not provided, DIRECTORY must already contain files and directory as if" @@ -54,7 +52,17 @@ push=0 subs="" renameFf=0 verbose=0 -repository=$repository_https +if [ -z "${PHYEXREPOprotocol-}" ]; then + repository="" +else + if [ $PHYEXREPOprotocol == 'https' ]; then + repository=https://github.com/$PHYEXREPOuser/PHYEX.git + elif [ $PHYEXREPOprotocol == 'ssh' ]; then + repository=git@github.com:$PHYEXREPOuser/PHYEX.git + else + repository="" + fi +fi while [ -n "$1" ]; do case "$1" in @@ -65,7 +73,7 @@ while [ -n "$1" ]; do '-s') subs="$subs $2"; shift;; '-p') push=1;; '--renameFf') renameFf=1;; - '--ssh') repository=$repository_ssh;; + '--repo') repository=$2; shift;; '-v') verbose=$(($verbose+1));; *) directory="$1";; esac