@@ -100,4 +100,76 @@ def test_parallel_routine_dispatch_decl_field_create_delete(here, frontend):
100
100
assert len (conditional ) == 5
101
101
for cond in conditional :
102
102
assert fgen (cond ) in field_delete
103
- breakpoint ()
103
+
104
+ @pytest .mark .parametrize ('frontend' , available_frontends (skip = [OMNI ]))
105
+ def test_parallel_routine_dispatch_derived_dcl (here , frontend ):
106
+
107
+ source = Sourcefile .from_file (here / 'sources/projParallelRoutineDispatch/dispatch_routine.F90' , frontend = frontend )
108
+ routine = source ['dispatch_routine' ]
109
+
110
+ transformation = ParallelRoutineDispatchTransformation ()
111
+ transformation .apply (source ['dispatch_routine' ])
112
+
113
+ dcls = [fgen (dcl ) for dcl in routine .spec .body [- 13 :- 1 ]]
114
+
115
+ test_dcls = ["REAL(KIND=JPRB), POINTER :: Z_YDVARS_U_T0(:, :, :)" ,
116
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_Q_DM(:, :, :)" ,
117
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_GEOMETRY_GELAM_T0(:, :)" ,
118
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_CVGQ_T0(:, :, :)" ,
119
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_Q_DL(:, :, :)" ,
120
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_V_T0(:, :, :)" ,
121
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_GEOMETRY_GEMU_T0(:, :)" ,
122
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_Q_T0(:, :, :)" ,
123
+ "REAL(KIND=JPRB), POINTER :: Z_YDCPG_PHY0_XYB_RDELP(:, :, :)" ,
124
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_CVGQ_DM(:, :, :)" ,
125
+ "REAL(KIND=JPRB), POINTER :: Z_YDCPG_DYN0_CTY_EVEL(:, :, :)" ,
126
+ "REAL(KIND=JPRB), POINTER :: Z_YDMF_PHYS_SURF_GSD_VF_PZ0F(:, :)" ,
127
+ "REAL(KIND=JPRB), POINTER :: Z_YDVARS_CVGQ_DL(:, :, :)" ]
128
+ for dcl in dcls :
129
+ assert dcl in test_dcls
130
+
131
+ @pytest .mark .parametrize ('frontend' , available_frontends (skip = [OMNI ]))
132
+ def test_parallel_routine_dispatch_derived_var (here , frontend ):
133
+
134
+ source = Sourcefile .from_file (here / 'sources/projParallelRoutineDispatch/dispatch_routine.F90' , frontend = frontend )
135
+ routine = source ['dispatch_routine' ]
136
+
137
+ transformation = ParallelRoutineDispatchTransformation ()
138
+ transformation .apply (source ['dispatch_routine' ])
139
+
140
+
141
+ ## test_dcls=["REAL(KIND=JPRB), POINTER :: Z_YDVARS_U_T0(:, :, :)",
142
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_Q_DM(:, :, :)",
143
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_GEOMETRY_GELAM_T0(:, :)",
144
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_CVGQ_T0(:, :, :)",
145
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_Q_DL(:, :, :)",
146
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_V_T0(:, :, :)",
147
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_GEOMETRY_GEMU_T0(:, :)",
148
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_Q_T0(:, :, :)",
149
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDCPG_PHY0_XYB_RDELP(:, :, :)",
150
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_CVGQ_DM(:, :, :)",
151
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDCPG_DYN0_CTY_EVEL(:, :, :)",
152
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDMF_PHYS_SURF_GSD_VF_PZ0F(:, :)",
153
+ ##"REAL(KIND=JPRB), POINTER :: Z_YDVARS_CVGQ_DL(:, :, :)"]
154
+ test_map = {
155
+ "YDVARS%GEOMETRY%GEMU%T0" : ["YDVARS%GEOMETRY%GEMU%FT0" , "Z_YDVARS_GEOMETRY_GEMU_T0" ],
156
+ "YDVARS%GEOMETRY%GELAM%T0" : ["YDVARS%GEOMETRY%GELAM%FT0" , "Z_YDVARS_GEOMETRY_GELAM_T0" ],
157
+ "YDVARS%U%T0" : ["YDVARS%U%FT0" , "Z_YDVARS_U_T0" ],
158
+ "YDVARS%V%T0" : ["YDVARS%V%FT0" , "Z_YDVARS_V_T0" ],
159
+ "YDVARS%Q%T0" : ["YDVARS%Q%FT0" , "Z_YDVARS_Q_T0" ],
160
+ "YDVARS%Q%DM" : ["YDVARS%Q%FDM" , "Z_YDVARS_Q_DM" ],
161
+ "YDVARS%Q%DL" : ["YDVARS%Q%FDL" , "Z_YDVARS_Q_DL" ],
162
+ "YDVARS%CVGQ%T0" : ["YDVARS%CVGQ%FT0" , "Z_YDVARS_CVGQ_T0" ],
163
+ "YDVARS%CVGQ%DM" : ["YDVARS%CVGQ%FDM" , "Z_YDVARS_CVGQ_DM" ],
164
+ "YDVARS%CVGQ%DL" : ["YDVARS%CVGQ%FDL" , "Z_YDVARS_CVGQ_DL" ],
165
+ "YDCPG_PHY0%XYB%RDELP" : ["YDCPG_PHY0%XYB%F_RDELP" , "Z_YDCPG_PHY0_XYB_RDELP" ],
166
+ "YDCPG_DYN0%CTY%EVEL" : ["YDCPG_DYN0%CTY%F_EVEL" , "Z_YDCPG_DYN0_CTY_EVEL" ],
167
+ "YDMF_PHYS_SURF%GSD_VF%PZ0F" : ["YDMF_PHYS_SURF%GSD_VF%F_Z0F" , "Z_YDMF_PHYS_SURF_GSD_VF_PZ0F" ]
168
+ }
169
+ for var_name in transformation .routine_map_derived :
170
+ value = transformation .routine_map_derived [var_name ]
171
+ field_ptr = value [0 ]
172
+ ptr = value [1 ]
173
+
174
+ assert test_map [var_name ][0 ] == field_ptr .name
175
+ assert test_map [var_name ][1 ] == ptr .name
0 commit comments