Changeset 4668 for BOL/Replay
- Timestamp:
- Sep 3, 2023, 3:16:49 PM (15 months ago)
- Location:
- BOL/Replay
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
BOL/Replay/replay_clean.sh
r4591 r4668 4 4 replay_comment="replay automatic include" 5 5 if [ $# = 0 ] ; then 6 \rm -f dump_replay*.h dump_param.h dump_ini.h input tmp tmp2 tmp3 tmp2_cpp 6 \rm -f dump_replay*.h dump_param.h dump_ini.h input tmp_get_subroutine_arg tmp_include_line tmp_include_line* tmp_include_line*_cpp tmp_include_line* 7 7 8 for file in `grep "$replay_comment" *F90 | cut -d: -f1` ; do 8 9 sed -i"" -e "/$replay_comment/d" $file -
BOL/Replay/replay_equip.sh
r4659 r4668 1 1 #!/bin/bash 2 2 3 # 3 #set -vx 4 4 5 5 #============================================================================= … … 117 117 wake|wake_popdyn_1|wake_popdyn_2|vdif_kcay|ustarhb) param_ini=wake_ini ; inimod=lmdz_wake_ini ; klon=klon ; klev=klev ;; 118 118 ratqs_main|ratqs_inter|ratqs_oro|ratqs_hetero|ratqs_tke) param_ini=ratqs_ini ; inimod=lmdz_ratqs_ini ; klon=klon ; klev=klev ;; 119 lscp ) param_ini=lscp_ini ; inimod=lscp_ini_mod; klon=klon ; klev=klev ;;119 lscp|fisrtilp) param_ini=lscp_ini ; inimod=lmdz_lscp_ini ; klon=klon ; klev=klev ;; 120 120 *) echo Cas non prevu ; exit 121 121 esac … … 136 136 137 137 function get_subroutine_arg(){ 138 cat $2 | tr '[A-Z]' '[a-z]' > tmp 139 line1=`sed -n -e '/subrou.*'\`echo $1 | tr '[A-Z]' '[a-z]'\`'.*(/=' tmp | head -1 ` 140 line2=`tail -n +$line1 tmp | sed -n -e '/)/=' | head -1` 141 tail -n +$line1 tmp | sed -n -e 1,${line2}p 138 tmp=tmp_get_subroutine_arg 139 cat $2 | tr '[A-Z]' '[a-z]' > ${tmp} 140 line1=`sed -n -e '/subrou.*'\`echo $1 | tr '[A-Z]' '[a-z]'\`'.*(/=' ${tmp} | head -1 ` 141 line2=`tail -n +$line1 ${tmp} | sed -n -e '/)/=' | head -1` 142 tail -n +$line1 ${tmp} | sed -n -e 1,${line2}p 142 143 } 143 144 … … 169 170 # $2 nom du fichier 170 171 # input <- routine under treatment with small caps only 171 ( cpp $2 2>/dev/null ) | tr '[A-Z]' '[a-z]' > tmp 172 tmp=tmp_extract_subroutine 173 ( cpp $2 2>/dev/null ) | tr '[A-Z]' '[a-z]' > ${tmp} 172 174 name_min=`echo $1 | tr '[A-Z]' '[a-z]'` 173 line1=`sed -n -e "/subrou.*${name_min}.*(/=" tmp| head -1 `174 tail -n +$line1 tmp > tmp2175 line2=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" tmp2 | head -1`176 head -$line2 tmp2 > input177 \rm -f tmp tmp2175 line1=`sed -n -e "/subrou.*${name_min}.*(/=" ${tmp} | head -1 ` 176 tail -n +$line1 ${tmp} > ${tmp}2 177 line2=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" ${tmp}2 | head -1` 178 head -$line2 ${tmp}2 > input 179 \rm -f ${tmp} ${tmp}2 178 180 } 179 181 … … 199 201 # Including param_dump*.h in the parameterization 200 202 #set -vx 203 tmp=tmp_include_line 201 204 line_to_be_included=$1 ; shift 202 205 param_=$1 ; shift … … 204 207 name_min=`echo $param_ | tr [A-Z] [a-z]` 205 208 line_subroutine=`cat $paramfile_ | tr '[A-Z]' '[a-z]' | sed -n -e "/subrou.*${name_min}.*(/=" | head -1 ` 206 tail -n +$line_subroutine $paramfile_ > tmp# file starting at the subroutine instruction207 line_return=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" tmp| head -1`208 head -$line_return tmp > tmp2 # file containing the routine209 sed -e 's/\!.*$//' tmp2 > tmp3210 cpp tmp2 > tmp3 2>/dev/null211 cat tmp3 | tr '[A-Z]' '[a-z]' > tmp2_cpp # same after cpp filtering212 last_line_declaration2="`sed -n -e 's/\!.*$//' -e 's/^/ /' -e '/[\ ,]real[\ ,]/p' -e '/[\ ,]integer[\ ,]/p' -e '/[\ ,]logical[\ ,]/p' -e '/[\ ,]character[\ ,]/p' tmp2_cpp | tail -1 | sed -e 's/ / /g' -e 's/ /.*/g'`"213 line_last_declaration=`cat tmp2 | tr '[A-Z]' '[a-z]' | sed -n -e "/$last_line_declaration2/="`209 tail -n +$line_subroutine $paramfile_ > ${tmp} # file starting at the subroutine instruction 210 line_return=`sed -n -e "/[Rr][Ee][Tt][Uu][Rr][Nn]/=" ${tmp} | head -1` 211 head -$line_return ${tmp} > ${tmp}2 # file containing the routine 212 sed -e 's/\!.*$//' ${tmp}2 > ${tmp}3 213 cpp ${tmp}2 > ${tmp}3 2>/dev/null 214 cat ${tmp}3 | tr '[A-Z]' '[a-z]' > ${tmp}2_cpp # same after cpp filtering 215 last_line_declaration2="`sed -n -e 's/\!.*$//' -e 's/^/ /' -e '/[\ ,]real[\ ,]/p' -e '/[\ ,]integer[\ ,]/p' -e '/[\ ,]logical[\ ,]/p' -e '/[\ ,]character[\ ,]/p' ${tmp}2_cpp | tail -1 | sed -e 's/ / /g' -e 's/ /.*/g'`" 216 line_last_declaration=`cat ${tmp}2 | tr '[A-Z]' '[a-z]' | sed -n -e "/$last_line_declaration2/="` 214 217 echo OK0 215 218 if [ "`grep -i 'end.*module' $paramfile_`" = "" ] ; then echo aka ; line_end_module=`wc -l $paramfile_ | awk ' { print $1 } '` ; else echo akb ; line_end_module=`sed -n -e '/[eE][nN][dD] .*[mM][oO][dD][uU][lL][eE]/=' $paramfile_` ; fi … … 223 226 -before_return) targeted_line=$line_return ;; 224 227 -before_end_module) targeted_line=$line_end_module ;; 225 -before_line|-after_line) linestr=`echo $1 | sed -e "s/$wtype //"` ; targeted_line=`sed -n -e "/$linestr/=" tmp2` ;;228 -before_line|-after_line) linestr=`echo $1 | sed -e "s/$wtype //"` ; targeted_line=`sed -n -e "/$linestr/=" ${tmp}2` ;; 226 229 *) echo Cas non prevu 0 where=$where in include_file 227 230 esac … … 429 432 close(90) 430 433 ...eod............................................... 434 for var_ in $varinmod ; do echo "print*,'Interface $param_ini $var_',$var_" >> $iniinc ; done 431 435 include_line "include \"$iniinc\"" $param_ini $inimod.F90 -before_return 432 436 fi # nconly = false 433 434 437 435 438 #-----------------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.