Skip to content

Commit fef003b

Browse files
New pyft version
1 parent de1ca4b commit fef003b

File tree

5 files changed

+48
-28
lines changed

5 files changed

+48
-28
lines changed

build/with_fcm/arch/arch-pgi_CPU_preGPU_MFflavour.env

+42-23
Original file line numberDiff line numberDiff line change
@@ -44,41 +44,60 @@ specificTransfos="^progs/:=:
4444
descTree=${TMPDIR:-/tmp}/descTree_$$
4545
trap "\rm -f $descTree" EXIT
4646

47-
#Transformation to apply systematically (IAL, Méso-NH and testprogs)
47+
#We cannot suppress non column calls for Méso-NH, stack transformation is replaced by allocatables
48+
#source this file, then: "export PYFT_OPTS_MNH; check_commit_mesonh.sh --prep_code-opts '--pyft_opts_env PYFT_OPTS_MNH' ...."
4849
#The --wrapH is automatically set by prep_code
4950
#The --mnhExpand is controlled by the different check_commit_* scripts
5051
#--addIncludes must be before --descTree because --addIncludes removes a wrong "file" node
51-
common_opts="--tree . --addIncludes --descTree $descTree --simplify --enableCache" #General options
52-
common_opts="$common_opts --inlineContainedSubroutinesPHYEX" #Inlining
53-
common_opts="$common_opts --deleteDrHook --deleteBudgetDDH" #Not available on GPU
54-
common_opts="$common_opts --addACC_routine_seq" #add 'acc routine' directive
55-
common_opts="$common_opts --stopScopes sub:SHALLOW_MF#sub:ICE_ADJUST#sub:RAIN_ICE#sub:RAIN_ICE_OLD#sub:TURB#sub:LIMA_ADJUST_SPLIT#sub:LIMA"
56-
common_opts="$common_opts --setFalseIfStmt TURBN%LTURB_DIAG --setFalseIfStmt TURBN%LTURB_FLX" #remove diagnostic output
57-
common_opts="$common_opts --buildACCTypeHelpers"
58-
59-
#We cannot suppress non column calls for Méso-NH, stack transformation is replaced by allocatables
60-
#source this file, then: "export PYFT_OPTS_MNH; check_commit_mesonh.sh --prep_code-opts '--pyft_opts_env PYFT_OPTS_MNH' ...."
61-
common_opts_MNH="$common_opts --addArrayParentheses --expandAllArraysPHYEX --attachArraySpecToEntity --applyCPPifdef %REPRO48 --replaceAutomaticWithAllocatable"
62-
PYFT_OPTS_MNH="$common_opts_MNH
52+
PYFT_OPTS_MNH="--tree . --addIncludes --descTree $descTree --simplify --enableCache" #General options
53+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --inlineContainedSubroutinesPHYEX" #Inlining
54+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --deleteDrHook --deleteBudgetDDH" #Not available on GPU
55+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --addACC_routine_seq" #add 'acc routine' directive
56+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --stopScopes sub:SHALLOW_MF#sub:ICE_ADJUST#sub:RAIN_ICE#sub:RAIN_ICE_OLD#sub:TURB#sub:LIMA_ADJUST_SPLIT#sub:LIMA"
57+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --setFalseIfStmt TURBN%LTURB_DIAG --setFalseIfStmt TURBN%LTURB_FLX" #remove diagnostic output
58+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --buildACCTypeHelpers"
59+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH --addArrayParentheses --expandAllArraysPHYEX --attachArraySpecToEntity --applyCPPifdef %REPRO48 --replaceAutomaticWithAllocatable"
60+
PYFT_OPTS_MNH="$PYFT_OPTS_MNH
6361
$specificTransfos
64-
^turb/mode_bl_depth_diag.F90:=:--removeCall module:MODE_BL_DEPTH_DIAG/sub:BL_DEPTH_DIAG_1D BL_DEPTH_DIAG_3D $common_opts_MNH
65-
^micro/rain_ice.F90:=:--removeCall sub:RAIN_ICE ELEC_TENDENCIES $common_opts_MNH"
62+
^turb/mode_bl_depth_diag.F90:=:--removeCall module:MODE_BL_DEPTH_DIAG/sub:BL_DEPTH_DIAG_1D BL_DEPTH_DIAG_3D $PYFT_OPTS_MNH
63+
^micro/rain_ice.F90:=:--removeCall sub:RAIN_ICE ELEC_TENDENCIES $PYFT_OPTS_MNH"
6664

6765
#For IAL, stack transformation is replaced by allocatables
6866
#source this file, then: "export PYFT_OPTS_IAL; check_commit_ial.sh --prep_code-opts '--pyft_opts_env PYFT_OPTS_IAL' ...."
69-
common_opts_IAL="$common_opts --addArrayParentheses --expandAllArraysPHYEX --attachArraySpecToEntity --applyCPPifdef REPRO48 --deleteNonColumnCallsPHYEX --replaceAutomaticWithAllocatable"
70-
PYFT_OPTS_IAL="$common_opts_IAL
67+
#The --wrapH is automatically set by prep_code
68+
#The --mnhExpand is controlled by the different check_commit_* scripts
69+
#--addIncludes must be before --descTree because --addIncludes removes a wrong "file" node
70+
PYFT_OPTS_IAL="--tree . --addIncludes --descTree $descTree --simplify --enableCache" #General options
71+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --inlineContainedSubroutinesPHYEX" #Inlining
72+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --deleteDrHook --deleteBudgetDDH" #Not available on GPU
73+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --addACC_routine_seq" #add 'acc routine' directive
74+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --stopScopes sub:SHALLOW_MF#sub:ICE_ADJUST#sub:RAIN_ICE#sub:RAIN_ICE_OLD#sub:TURB#sub:LIMA_ADJUST_SPLIT#sub:LIMA"
75+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --setFalseIfStmt TURBN%LTURB_DIAG --setFalseIfStmt TURBN%LTURB_FLX" #remove diagnostic output
76+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --buildACCTypeHelpers"
77+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL --addArrayParentheses --expandAllArraysPHYEX --attachArraySpecToEntity --applyCPPifdef REPRO48 --deleteNonColumnCallsPHYEX --replaceAutomaticWithAllocatable"
78+
PYFT_OPTS_IAL="$PYFT_OPTS_IAL
7179
$specificTransfos
72-
^turb/mode_bl_depth_diag.F90:=:--removeCall module:MODE_BL_DEPTH_DIAG/sub:BL_DEPTH_DIAG_1D BL_DEPTH_DIAG_3D $common_opts_IAL
73-
^micro/rain_ice.F90:=:--removeCall sub:RAIN_ICE ELEC_TENDENCIES $common_opts_IAL"
80+
^turb/mode_bl_depth_diag.F90:=:--removeCall module:MODE_BL_DEPTH_DIAG/sub:BL_DEPTH_DIAG_1D BL_DEPTH_DIAG_3D $PYFT_OPTS_IAL
81+
^micro/rain_ice.F90:=:--removeCall sub:RAIN_ICE ELEC_TENDENCIES $PYFT_OPTS_IAL"
7482

7583
#For testprogs
7684
#check_commit_testprogs.sh -a <this conf>
7785
#For --removeIJDim, the USE_COLCALL compilation key must be set in the *.fcm file
7886
#--removeIJDim internally applies --addArrayParentheses --expandAllArraysPHYEX and, if --simplify is set, attachArraySpecToEntity
79-
common_opts="$common_opts --applyCPPifdef REPRO48 --deleteNonColumnCallsPHYEX --removeIJDim --addStack $stackMode"
80-
PYFT_OPTS="$common_opts
87+
#The --wrapH is automatically set by prep_code
88+
#The --mnhExpand is controlled by the different check_commit_* scripts
89+
#--addIncludes must be before --descTree because --addIncludes removes a wrong "file" node
90+
PYFT_OPTS="--tree . --addIncludes --descTree $descTree --simplify --enableCache" #General options
91+
PYFT_OPTS="$PYFT_OPTS --inlineContainedSubroutinesPHYEX" #Inlining
92+
PYFT_OPTS="$PYFT_OPTS --deleteDrHook --deleteBudgetDDH" #Not available on GPU
93+
#PYFT_OPTS="$PYFT_OPTS --addACC_routine_seq" #add 'acc routine' directive
94+
PYFT_OPTS="$PYFT_OPTS --stopScopes sub:SHALLOW_MF#sub:ICE_ADJUST#sub:RAIN_ICE#sub:RAIN_ICE_OLD#sub:TURB#sub:LIMA_ADJUST_SPLIT#sub:LIMA"
95+
PYFT_OPTS="$PYFT_OPTS --setFalseIfStmt TURBN%LTURB_DIAG --setFalseIfStmt TURBN%LTURB_FLX" #remove diagnostic output
96+
PYFT_OPTS="$PYFT_OPTS --buildACCTypeHelpers"
97+
PYFT_OPTS="$PYFT_OPTS --applyCPPifdef REPRO48 --deleteNonColumnCallsPHYEX --removeIJDim --addStack $stackMode"
98+
PYFT_OPTS="$PYFT_OPTS --removeACC --addACC_routine_seq" #remove pre-existing ACC directives, then add 'acc routine seq' directive
99+
PYFT_OPTS="$PYFT_OPTS
81100
$specificTransfos
82-
^turb/mode_bl_depth_diag.F90:=:--removeCall module:MODE_BL_DEPTH_DIAG/sub:BL_DEPTH_DIAG_1D BL_DEPTH_DIAG_3D $common_opts
83-
^micro/rain_ice.F90:=:--removeCall sub:RAIN_ICE ELEC_TENDENCIES $common_opts"
101+
^turb/mode_bl_depth_diag.F90:=:--removeCall module:MODE_BL_DEPTH_DIAG/sub:BL_DEPTH_DIAG_1D BL_DEPTH_DIAG_3D $PYFT_OPTS
102+
^micro/rain_ice.F90:=:--removeCall sub:RAIN_ICE ELEC_TENDENCIES $PYFT_OPTS"
84103

tools/INSTALL.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55
set -o pipefail #abort if left command on a pipe fails
66

7-
pyft_version=3bead4d4b54baafc113f239f72e8bd90b6381dcc
7+
pyft_version=f63de396176e3e91a5cdedae2d098dbbe3497ae2
88

99
#This script installs PHYEX
1010
#Call the script with the -h option to get more information.

tools/check_commit_ial.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ if [ $packupdate -eq 1 -o $packcreation -eq 1 ]; then
536536
cd $HOMEPACK/$name/src/local/phyex
537537

538538
if [ $useexpand == 1 ]; then
539-
expand_options="--mnhExpand"
539+
expand_options="--mnhExpand --removeACC"
540540
else
541541
expand_options=""
542542
fi

tools/prep_code.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function usage {
2323
echo " or a tag with the following syntax: tags/TAG where TAG is the tag name"
2424
echo "-m MODEL merge the code under the common directory with the code specific to MODEL model"
2525
echo "--mnhExpand option passed to the pyft tool"
26+
echo "--removeACC option passed to the pyft tool"
2627
echo "-p push the result as a new branch"
2728
echo "-s SUB subdiretory or file (under src) to consider when merging and applying pyft"
2829
echo "--renameFf rename .F90 into .f90"
@@ -38,7 +39,7 @@ function usage {
3839
echo "* If the -c option is not provided, DIRECTORY must already contain files and directory as if"
3940
echo " it was the result of a git checkout"
4041
echo "* If the -m option is used, directory tree is modified, only relevant code is kept"
41-
echo "* If --mnhExpand is not used, pyft is not called at all"
42+
echo "* If none of --mnhExpand, --removeACC, --pyft_opts_env or PYFT_OPTIONS is not used, pyft is not called at all"
4243
echo "* -s options are mandatory for -m, -D and -p options"
4344
echo "* -p option is allowed only if -c and -m options are provided"
4445
echo ""
@@ -101,6 +102,7 @@ while [ -n "$1" ]; do
101102
'-c') checkout_point="$2"; shift;;
102103
'-m') model="$2"; shift;;
103104
'--mnhExpand') pyft_options="$pyft_options $1";;
105+
'--removeACC') pyft_options="$pyft_options $1";;
104106
'-s') subs="$subs $2"; shift;;
105107
'-p') push=1;;
106108
'--renameFf') renameFf=1;;

tools/pybinding.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def pybinding(fortran_in, scope, fortran_out, python_out, libso,
4444
'func': 'FUNCTION'}[kind]
4545

4646
#Loop on all the dummy arguments and prepare their use
47-
varList = pftin.getVarList()
4847
argList1 = [] #argument list of the main public interface
4948
argList2 = [] #argument list to the existing FORTRAN routine
5049
moduleList = [] #declarative module to add
@@ -56,7 +55,7 @@ def pybinding(fortran_in, scope, fortran_out, python_out, libso,
5655
docstringIN = ["Input arguments:"]
5756
docstringOUT = ["Output arguments:"]
5857
for N in scopeNode.findall('.//{*}dummy-arg-LT/{*}arg-N/{*}N'):
59-
var = pftin.findVar(n2name(N), scope, varList=varList, exactScope=True)
58+
var = pftin.varList.findVar(n2name(N), scope, exactScope=True)
6059
vartype = var['t'].replace(' ', '').upper()
6160
if vartype == 'TYPE(DIMPHYEX_T)':
6261
moduleList.append('USE MODD_DIMPHYEX, ONLY: DIMPHYEX_t')

0 commit comments

Comments
 (0)