New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
internal_nl_workaround.pl in NEMO/trunk/tests/DIA_GPU – NEMO

source: NEMO/trunk/tests/DIA_GPU/internal_nl_workaround.pl

Last change on this file was 14846, checked in by mcastril, 3 years ago

[2021/HPC-11_mcastril_HPDAonline_DiagGPU] Correct internal_nl_workaround.pl and cpp_DIA_GPU.fcm

  • Property svn:executable set to *
File size: 807 bytes
Line 
1INUNITS=( numnam_ref numnam_cfg numnat_ref numnat_cfg numtrc_ref numtrc_cfg numnam_ice_ref numnam_ice_cfg numnamsed_ref numnamsed_cfg numnatp_cfg numnatp_ref )
2#
3# build a list of files that need to be changed
4#
5listfile=tmplistfile$$.txt
6for iunit in ${INUNITS[@]}
7do
8  grep -l $iunit `find ./ -name '*.[fFh]90'` >>  $listfile
9done
10allfiles=`cat $listfile | sort -u`
11echo $allfiles
12#
13if [ -f $listfile ] ; then rm $listfile; fi
14for f in  $allfiles
15do
16 echo "Working on " $f
17 n=0
18 for n in `seq 0 1 $(( ${#INUNITS[*]} - 1 ))`
19 do
20   numnam=${INUNITS[$n]}
21   perl -ni -e 'unless ( m@.*\s*READ\s*\(\s*'${INUNITS[$n]}'\s*,\s*[a-z,0-9]*.*@) { print  } else { $line= $_ ; $line=~s@(.*\s*READ\s*\()(\s*)('${INUNITS[$n]}')(\s*,\s*)([a-z0-9_]*)(.*)@\1\2\3(INDEX(\3,"\5 ")-1:)\4\5\6@i ; print $line }' $f
22 done
23done
Note: See TracBrowser for help on using the repository browser.